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

Don't close the client instance in DropwizardApacheConnector #1232

Merged
merged 1 commit into from Aug 24, 2015

Conversation

Projects
None yet
3 participants
@arteam
Member

arteam commented Aug 20, 2015

Jersey expects that we create a new instance of the Apache HTTP client every time, when we create a new instance of the connector.

So, when ClientRuntime is garbage collected, the client is closed and new requests, that work with a new connector, use already closed client.

The fix is to not close the client in the connector. We can rely on the fact, that the client is managed by Dropwizard environment and it will be closed, when the application will be shut down.

Also users of Apache HTTP Client keep the ability to close the client manually, if they want to.

Fix #1160

Don't close the client instance in DropwizardApacheConnector
Jersey expects that we create a new instance of the Apache HTTP client
every time, when we create a new instance of the connector.

So, when `ClientRuntime` is garbage collected, the client is closed
and new requests, that work with a new connector, use already closed client.

The fix is to not close the client in the connector. We can rely on the fact,
that the client is managed by Dropwizard environment and it will be closed,
when the application will be shut down.

Also users of Apache HTTP Client keep the ability to close the client manually,
if they want to.

Fix #1160
@carlo-rtr

This comment has been minimized.

Show comment
Hide comment
@carlo-rtr

carlo-rtr Aug 24, 2015

Member

closed / reponed to retrigger travis ci

Member

carlo-rtr commented Aug 24, 2015

closed / reponed to retrigger travis ci

@joschi

This comment has been minimized.

Show comment
Hide comment
@joschi

joschi Aug 24, 2015

Member

@carlo-rtr You can restart failed jobs directly at Travis CI: https://travis-ci.org/dropwizard/dropwizard

Member

joschi commented Aug 24, 2015

@carlo-rtr You can restart failed jobs directly at Travis CI: https://travis-ci.org/dropwizard/dropwizard

carlo-rtr added a commit that referenced this pull request Aug 24, 2015

Merge pull request #1232 from arteam/not_close_apache_client
Don't close the client instance in DropwizardApacheConnector

@carlo-rtr carlo-rtr merged commit 61887ca into dropwizard:master Aug 24, 2015

@carlo-rtr

This comment has been minimized.

Show comment
Hide comment
@carlo-rtr

carlo-rtr Aug 24, 2015

Member

thanks @joschi didn't realize that

Member

carlo-rtr commented Aug 24, 2015

thanks @joschi didn't realize that

@joschi joschi added this to the 0.9.0 milestone Aug 24, 2015

@arteam arteam deleted the arteam:not_close_apache_client branch Jan 24, 2016

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