Skip to content
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

fix conn pool leak when acquire future is cancelled #437

Merged
merged 5 commits into from
Feb 7, 2022

Conversation

aajtodd
Copy link
Contributor

@aajtodd aajtodd commented Feb 1, 2022

Issue #, if available:
see awslabs/aws-sdk-kotlin#511

Description of changes:
Check if the connection acquire future is actually completed by the callback. If not (likely due to cancellation) then return it immediately to the pool otherwise it will leak and future acquisitions will fail/hang.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@aajtodd aajtodd requested a review from bretambrose February 1, 2022 17:45
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

Very minor and probably a result of IDE settings, but I think we have a preference for keeping imports explicit and not wild-carded.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup IDE auto import settings, will fix

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