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

ChunkedInput.close is not sufficient to release client connections #5679

Closed
eddsteel opened this issue Jun 17, 2024 · 2 comments · Fixed by #5705
Closed

ChunkedInput.close is not sufficient to release client connections #5679

eddsteel opened this issue Jun 17, 2024 · 2 comments · Fixed by #5705

Comments

@eddsteel
Copy link

Hi folks,

We observed a connection leak in our dropwizard service, using jersey-client 2.41 to call an endpoint with chunked encoding. The code receives a ChunkedInput, processes it, then closes it. We expected this would be sufficient to close the underlying input stream and release the connection, but open connections just increase until the pool is exhausted.

I reproduced the issue here and raised a dropwizard issue. Steffen's reply clearly laid out the reasons for the behaviour (I won't add noise here). This situation seems to be by design in Jersey, specifically jersey-common 2.41.

We can release the resources by returning both a ChunkedInput and a Response object, and closing both. But this seems inconsistent with other parts of the API and the spec where closing an underlying input will have the same effect. I'm not necessarily asking you to change anything, but would be interested in your thoughts on what Steffen said.

Thanks!

@jansupol jansupol linked a pull request Jul 25, 2024 that will close this issue
@jansupol
Copy link
Contributor

jansupol commented Jul 25, 2024

Thanks @eddsteel. It looks like the bug has been there for at least 6 years by now.

@eddsteel
Copy link
Author

Thanks for having a look @jansupol !

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 a pull request may close this issue.

2 participants