-
Notifications
You must be signed in to change notification settings - Fork 186
Description
- I have checked that the SDK documentation doesn't solve my issue.
- I have checked that the API documentation doesn't solve my issue.
- I have searched the Box Developer Forums and my issue isn't already reported (or if it has been reported, I have attached a link to it, for reference).
- I have searched Issues in this repo and my issue isn't already reported.
Description of the Issue
- App user is an owner of a folder, and also is a collaborator with role “Viewer” in another user’s file.
- App user is trying to download the file from the user’s box account and upload it as new version to the owned folder.
- The download and upload process happen in parallel and in an asynchronous way, downloading the file from box and writing it to an output stream, meanwhile uploading the downloaded part using an input stream connected to the output stream.
The above behavior is being done using PipedOutputStream, and PipedInputStream. It is working fine using Box SDK 3.3.0. But, when we migrated to use SDK 4.0.1, we started to get and exception that:
java.util.concurrent.CompletionException: java.lang.RuntimeException: java.io.IOException: Pipe closed
at org.springframework.aop.interceptor.AsyncExecutionAspectSupport.lambda$doSubmit$3(AsyncExecutionAspectSupport.java:281) ~[spring-aop-5.3.20.jar:5.3.20]
at org.springframework.aop.interceptor.AsyncExecutionAspectSupport$$Lambda$1300.000000001A83A8F0.get(Unknown Source) ~[na:na]
Steps to Reproduce
- Spring boot application which is downloading a file from box and upload that downloaded file as a new version to another target file.
- Given PipedOutputStream out, and PipedInputStream in = new PipedInputStream(8192).
- in.connect(out);
- Download the file to the "out"
- Upload the new version from the "in"
Expected Behavior
Error Message, Including Stack Trace
java.util.concurrent.CompletionException: java.lang.RuntimeException: java.io.IOException: Pipe closed
at org.springframework.aop.interceptor.AsyncExecutionAspectSupport.lambda$doSubmit$3(AsyncExecutionAspectSupport.java:281) ~[spring-aop-5.3.20.jar:5.3.20]
at org.springframework.aop.interceptor.AsyncExecutionAspectSupport$$Lambda$1300.000000001A83A8F0.get(Unknown Source) ~[na:na]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1601) ~[na:1.8.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160) ~[na:1.8.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:1.8.0]
Screenshots
Versions Used
Java SDK: 4.0.1
Java: 1.8.0_291