Skip to content

Offload completion of execution future to a separate thread #2557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2021

Conversation

zoewangg
Copy link
Contributor

@zoewangg zoewangg commented Jun 25, 2021

Description

Offload completion of execution future to a separate thread to prevent the CRT threads being blocked by complex operations in the completion chain of a completable future

Motivation and Context

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 read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed
  • A short description of the change has been added to the CHANGELOG
  • 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

Copy link
Contributor

@Bennett-Lynch Bennett-Lynch left a comment

Choose a reason for hiding this comment

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

LGTM overall. Left some mostly nitpicky feedback.

int maxPoolSize = Math.max(64, processors * 2);
ThreadPoolExecutor executor = new ThreadPoolExecutor(corePoolSize, maxPoolSize,
10, TimeUnit.SECONDS,
new LinkedBlockingQueue<>(1_000),
Copy link
Contributor

Choose a reason for hiding this comment

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

What are the pros and cons of LinkedBlockingQueue vs. SynchronousQueue here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't remember why we decided to go with LinkedBlockingQueue. @millems @dagnir do either of you remember?

@zoewangg zoewangg force-pushed the zoewang/offloadCompletion branch from 45a9e4f to 2ce01a5 Compare June 26, 2021 00:09
@zoewangg zoewangg force-pushed the zoewang/offloadCompletion branch from 2ce01a5 to 005370e Compare June 26, 2021 00:16
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

84.7% 84.7% Coverage
0.0% 0.0% Duplication

@zoewangg zoewangg merged commit 03df45f into feature/master/transfermanager Jun 26, 2021
@zoewangg zoewangg deleted the zoewang/offloadCompletion branch June 26, 2021 01:03
aws-sdk-java-automation added a commit that referenced this pull request May 11, 2023
…9a62c5f9c

Pull request: release <- staging/35a236a8-3c54-40fd-b3d8-e069a62c5f9c
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