question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] DataLakeFileClient.uploadFromFile() times out at 60 secs even when duration is specified

See original GitHub issue

Description Attempting to upload large files to Azure Datalake container. The method uploadFromFile() in the DataLakeFileClient consistently throws exception java.util.concurrent.TimeoutException: Channel response timed out after 60000 milliseconds.

Exception or Stack Trace

reactor.core.Exceptions$ReactiveException: java.util.concurrent.TimeoutException: Channel response timed out after 60000 milliseconds.
	at reactor.core.Exceptions.propagate(Exceptions.java:392)
	at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:137)
	at reactor.core.publisher.Mono.block(Mono.java:1731)
	at com.azure.storage.common.implementation.StorageImplUtils.blockWithOptionalTimeout(StorageImplUtils.java:193)
	at com.azure.storage.file.datalake.DataLakeFileClient.uploadFromFile(DataLakeFileClient.java:485)
	at com.litens.etl.datalake.TestUpload.uploadToAzureStorage(TestUpload.java:59)
	at com.litens.etl.datalake.TestUpload.main(TestUpload.java:25)
	Suppressed: java.lang.Exception: #block terminated with an error
		at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:139)

Caused by: java.util.concurrent.TimeoutException: Channel response timed out after 60000 milliseconds.
	at com.azure.core.http.netty.implementation.ResponseTimeoutHandler.responseTimedOut(ResponseTimeoutHandler.java:58)
	at com.azure.core.http.netty.implementation.ResponseTimeoutHandler.lambda$handlerAdded$0(ResponseTimeoutHandler.java:45)
	at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
	at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153)
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:833)

To Reproduce See sample code below

Code Snippet

public void uploadToAzureStorage(File file) throws FileNotFoundException
{
    String fileName = file.getName();
    String endPoint = "https://mydatalake.dfs.core.windows.net/datalake-file-system/qsys-data-export/" + fileName;
    String sasToken = "?sv=2021-06-08&ss=abcdefghijklmnopqrstuvwxyz=mysas";
    String fileSystemName = "datalake-file-system";

    DataLakeFileClient fileClient = new DataLakePathClientBuilder()
        .endpoint(endPoint)
        .sasToken(sasToken)
        .fileSystemName(fileSystemName)
        .buildFileClient();
    
    PathHttpHeaders headers = new PathHttpHeaders()
        .setContentMd5("data".getBytes(StandardCharsets.UTF_8))
        .setContentLanguage("en-US")
        .setContentType("binary");
    Long blockSize = 100L * 1024L * 1024L; // 100 MB;
    ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions().setBlockSizeLong(blockSize);
    Map<String, String> metadata = Collections.singletonMap("metadata", "value"); 
    DataLakeRequestConditions requestConditions = new DataLakeRequestConditions();  
    Duration timeout = Duration.ofMinutes(10);
    
    LocalDateTime start = LocalDateTime.now();
    System.out.println("Start upload: " + start);
    fileClient.uploadFromFile(file.getAbsolutePath(), parallelTransferOptions, headers, metadata, requestConditions, timeout);
    LocalDateTime end = LocalDateTime.now();
    System.out.println("End upload: " + end);
}

Expected behavior File should upload to blob storage in the data lake container. Smaller files make it no problem, but files above 500 MB throw the timeout error.

Setup (please complete the following information):

  • OS: Windows 10 20H2
  • IDE: Visual Studio Code 64-bit
  • Library/Libraries: com.azure; azure-storage-file-datalake-12.11.0, com.azure; azure-storage-blob-12.18.0
  • Java version: 11.0.15 64-bit

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rickle-msftcommented, Aug 12, 2022

@ptownsen Ok. I will try your sample code and see if I can get a repro

0reactions
rickle-msftcommented, Aug 17, 2022

Awesome! So glad to hear it! Thanks for your patience working with us!

Read more comments on GitHub >

github_iconTop Results From Across the Web

DataLakeFileClient Class - Microsoft Learn
Creates a file, with the content of the specified file. Response<PathInfo>. uploadWithResponse(FileParallelUploadOptions options, Duration timeout, Context ...
Read more >
DataLakeFileClient (Azure SDK for Java Reference ... - NET
Creates a new DataLakeFileClient with the specified customerProvidedKey . ... uploadWithResponse(FileParallelUploadOptions options, Duration timeout, ...
Read more >
Solve timeout errors on file uploads with new azure.storage ...
upload() fails on larger files with a timeout error that completely ignores the timeout parameter of the function. I get a ServiceResponseError ...
Read more >
Last issues related to azure-services - PullAnswer
[QUERY] Tune com.azure.messaging.servicebus to not log error level messages on ... uploadFromFile() times out at 60 secs even when duration is specified.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found