Skip to content

Update AsyncRetryableStage + tests#7192

Open
dagnir wants to merge 2 commits into
feature/master/adaptive-retries-fixesfrom
dongie/adaptive-fix-pt4-2
Open

Update AsyncRetryableStage + tests#7192
dagnir wants to merge 2 commits into
feature/master/adaptive-retries-fixesfrom
dongie/adaptive-fix-pt4-2

Conversation

@dagnir

@dagnir dagnir commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

Modifications

  • Update AsyncRetryableStage to use the new *Async methods from RetryStrategy
  • Update AdaptiveRetryRateLimitingTest to test both sync and async clients
  • Update other tests to wait on future to avoid timing issues

Testing

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@dagnir
dagnir requested a review from a team as a code owner July 24, 2026 17:36
@dagnir dagnir changed the title Dongie/adaptive fix pt4 2 Update AsyncRetryableStage + tests Jul 24, 2026
@dagnir
dagnir force-pushed the dongie/adaptive-fix-pt4-2 branch from fea4acb to 164c461 Compare July 24, 2026 20:20
dagnir added 2 commits July 24, 2026 13:21
 - Update AsyncRetryableStage to use the new *Async methods from
   RetryStrategy
 - Update AdaptiveRetryRateLimitingTest to test both sync and async
   clients
 - Update other tests to wait on future to avoid timing issues
If S3MetaRequestPauseObservable#pause is invoked before
S3MetaRequestPauseObservable#subscribe is executed, an NPE can occur.
This can happen if the transfer hasn't actually begin before the pause()
was invoked.

Fix this by returning `null` in this case, which `CrtFileUpload` treats
as transfer not yet started.
@dagnir
dagnir force-pushed the dongie/adaptive-fix-pt4-2 branch from 164c461 to 70480b3 Compare July 24, 2026 20:21
@dagnir
dagnir requested a review from davidh44 July 24, 2026 22:12
if (acquireFailureDelay.isPresent()) {
Duration acquireDelay = acquireFailureDelay.get();
context.executionAttributes().putAttribute(LAST_BACKOFF_DELAY_DURATION, acquireDelay);
cf.complete(Either.right(acquireDelay));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a return here in this branch after complete(). Maybe a test case for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch. I don't think it actually matters though, because if you fall through to the second complete, it becomes a no-op.

CompletableFuture<AllTypesResponse> responseFuture = client.allTypes(r -> {
});
responseFuture.cancel(true);
// Thread.sleep(1000);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover commented code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants