[BUG] DataLakeFileClient.uploadFromFile() times out at 60 secs even when duration is specified
See original GitHub issueDescription 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:
- Created a year ago
- Comments:9 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ptownsen Ok. I will try your sample code and see if I can get a repro
Awesome! So glad to hear it! Thanks for your patience working with us!