Open JmKanmo opened 1 year ago
둘다 정상적으로 동작하지 않습니다.
When uploading file,
Transfer initiated...
| | 0.0%
|= | 5.5%
|== | 10.3%
|=== | 15.0%
|==== | 20.6%
|===== | 25.3%
|====== | 30.1%
|======= | 35.6%
|======== | 40.4%
|========= | 45.1%
|========== | 50.7%
|=========== | 55.5%
|============ | 60.2%
|============= | 65.0%
|============== | 70.5%
|=============== | 75.3%
|================ | 80.0%
|================= | 85.6%
|================== | 90.3%
|=================== | 95.1%
|====================| 100.0%
... 4min 22 sec later
Transfer complete!
below code
UploadFileRequest uploadFileRequest =
UploadFileRequest.builder()
.putObjectRequest(b -> b.bucket(WHATAP_AWS_BUCKET_NAME).key(WHATAP_DESTINATION_KEY))
.addTransferListener(LoggingTransferListener.create())
.source(Paths.get(filePath))
.build();
stopWatch.start();
FileUpload fileUpload = transferManager.uploadFile(uploadFileRequest);
CompletedFileUpload uploadResult = fileUpload.completionFuture().join();
When uploading byte arrays
UploadRequest uploadRequest = UploadRequest.builder()
.putObjectRequest(b -> b.bucket(WHATAP_AWS_BUCKET_NAME).key(WHATAP_DESTINATION_KEY))
.addTransferListener(LoggingTransferListener.create())
.requestBody(AsyncRequestBody.fromBytes(originBytes))
.build();
It need to fix this bug.
I think the current TransferListener is monitoring the progress of the conversion from File -> byte array.
Therefore, when uploading a byte array,
0.0% => 100% => after a while -> completed
as shown above.
When uploading with Paths.get(dir), the progress is monitored as
0.0% => 32.6% => 65.3% => 98.0% => 100.0% => after a while => completed.
Users using s3 uploads/downloads want to see the full progress of the final upload to s3, not the file->to-byte-array conversion. The above matters are judged to need improvement. So, please work on improving the request.
Transferring to the Java SDK v2 repo.
I think we got a previous report of this same issue but I couldn't find it here...
Found it - https://github.com/aws/aws-sdk-java-v2/issues/3670.
@JmKanmo I'll keep this open too, since you provided a lot of repro steps.
I believe we hit this bug as well.
What we observe when uploading a file is this:
TransferListener.bytesTransferred
gets called with increasing values in rapid succession:
0.0% => 32.6% => 65.3% => 98.0% => 100.0%
After we've already reached 100%, minutes pass without any calls to TransferListener.bytesTransferred
.
Presumably the real transfer happens during this long pause.
Finally the transfer ends.
It seems, as someone pointed out in a previous comment, that the progress being tracked is for transferring bytes from the file into some memory buffer, not transferring them to S3.
NB: We're uploading a file, not a byte array.
Describe the bug
0.0 => 100.0% => (4min 25sec later) => Transfer complete!
It didn't show process percent gradually.
source code
I impleneted TransferListener classs. (S3PrintStackListener)
capture
Expected Behavior
Below code is s3 file download. It work properly.
The progress percent image is below
Current Behavior
I think this problem no needed include log
Reproduction Steps
Just watch console
Possible Solution
No response
Additional Information/Context
No response
AWS Java SDK version used
software.amazon.awssdk 2.20.76, software.amazon.awssdk.s3-transfer-manager 2.20.75, software.amazon.awssdk.crt.aws-crt 0.21.17
JDK version used
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
Operating System and version
MacBookPro18