Skip to content

Conversation

thornhillcody
Copy link

  • Synchronize replacement of scheduled flush in RequestBatchBuffer to prevent orphaned, uncanceled scheduled flushes

Motivation and Context

This change enables the SqsAsyncBatchManager to make batches of correct size during high concurrency. More info in #6374

Modifications

I chose to synchronize the cancel and assignment of the scheduledFlush in RequestBatchBuffer.putScheduledFlush(). This is the only place this is used and it's an internal API, so I felt comfortable changing the name to make it more clear what it's doing.

Testing

Ran sample app used to reproduce the issue (found in bug report) and verified the average batch sizes were as expected with 500 TPS, 1000 TPS, 5000 TPS.

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

@thornhillcody thornhillcody requested a review from a team as a code owner August 27, 2025 20:17
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.

1 participant