Skip to content

Enable idle connection reaper for Apache client #754

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 2 commits into from
Oct 11, 2018

Conversation

dagnir
Copy link
Contributor

@dagnir dagnir commented Oct 10, 2018

Description

Motivation and Context

Testing

Added new tests.

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

License

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

@dagnir dagnir requested a review from shorea October 10, 2018 23:58
}
public boolean registerConnectionManager(HttpClientConnectionManager manager, long maxIdleTime) {
boolean notPreviouslyRegistered = connectionManagers.put(manager, maxIdleTime) == null;
if (notPreviouslyRegistered) {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need the check of not previously registered since we are checking if the exec is null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, don't think it's necessary.

shutdown();
public boolean deregisterConnectionManager(HttpClientConnectionManager manager) {
boolean wasRemoved = connectionManagers.remove(manager) != null;
if (wasRemoved) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't follow this. Shouldn't we only shutdown if all connection managers are de-registered?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Woops! Yeah should be an empty check

@Override
public void run() {
while (true) {
if (stopping) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just put this in the while? while(!stopping)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@dagnir dagnir force-pushed the idle-connection-reaper branch from 6948203 to 88db521 Compare October 11, 2018 00:46
@dagnir dagnir merged commit 4ff5bb5 into aws:master Oct 11, 2018
aws-sdk-java-automation added a commit that referenced this pull request Mar 11, 2020
…ef632f8f

Pull request: release <- staging/2b200b34-8d28-42cb-b359-a073ef632f8f
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