Skip to content

Transfer.waitForCompletion() completes even TransferState is Waiting #3169

@iLoveOctoCat

Description

@iLoveOctoCat

Upcoming End-of-Support

  • I acknowledge the upcoming end-of-support for AWS SDK for Java v1 was announced, and migration to AWS SDK for Java v2 is recommended.

Describe the bug

In our spring boot application, we are using transferManager and uploadFileList method to upload a file. Also, we are waiting for upload to get completed with blocking operation waitForCompletion() but intermittently for few requests waitForCompletion method returning the control to the actual main thread even though Transfer state is Waiting where as per the documentation we were expecting waitForCompletion() to return the control the actual thread only after the transfer is complete i.e Transfer state is one of the Completed, Canceled or Failed.

// @Autowired private TransferManager transferManagerClient;
multipleFileUpload = transferManagerClient.uploadFileList(bucketName, filePath, directory, fileList);
multipleFileUpload.waitForCompletion();

log.info("File uploaded to S3: {}", multipleFileUpload.getState()); // this logs state as Waiting 

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

waitForCompletion() to return the control the actual thread only after the transfer is complete i.e Transfer state is one of the Completed, Canceled or Failed

Current Behavior

Intermittently, waitForCompletion() to returns the control the actual thread even if transfer state is Waiting.

Reproduction Steps

This issue is intermittent and seems like concurrency issue. Hence, hard to reproduce.

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

1.12.261

JDK version used

17

Operating System and version

TBA

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.closed-for-stalenessp2This is a standard priority issueresponse-requestedWaiting on additional info or feedback. Will move to "closing-soon" in 5 days.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions