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

Dialogue guards against HTTPCLIENT-1924 client self-closure #1951

Merged
merged 3 commits into from
Jun 13, 2023

Conversation

carterkozak
Copy link
Contributor

Before this PR

The underlying http client closes itself when an Error is thrown.

After this PR

==COMMIT_MSG==
Dialogue guards against HTTPCLIENT-1924 client self-closure
==COMMIT_MSG==

Possible downsides?

In cases that would previously self-close, we're guaranteed that a connection will leak. Our connection pool allows two billion entries, so it's not the worst thing in the world so long as it doesn't happen in a hot loop, which is unlikely, and in the unlikely worst case causes similar issues to the self-closure problem.

@changelog-app
Copy link

changelog-app bot commented Jun 13, 2023

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Dialogue guards against HTTPCLIENT-1924 client self-closure

Check the box to generate changelog(s)

  • Generate changelog entry

@carterkozak carterkozak requested review from bjlaub and mpritham June 13, 2023 16:19
@carterkozak carterkozak force-pushed the ckozak/hc_self_closure branch from 86f3e7b to 7111a5f Compare June 13, 2023 16:26

@Override
public void writeTo(OutputStream _output) {
throw new StackOverflowError();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes for a nice test, and I suspect is similar to the issue which prompted this change, but in practice I don't think httpclient should actually close the connection pool when an error is thrown from this portion of the request. I will follow up separately on that.

Comment on lines +88 to +89
* https://github.com/apache/httpcomponents-client/blob/5b61e132c3871ddfa967ab21b3af5d6d738bc6e8/
* httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/MainClientExec.java#L161-L164
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bulldozer-bot bulldozer-bot bot merged commit 0e561d6 into develop Jun 13, 2023
@bulldozer-bot bulldozer-bot bot deleted the ckozak/hc_self_closure branch June 13, 2023 16:49
@svc-autorelease
Copy link
Collaborator

Released 3.85.0

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

Successfully merging this pull request may close these issues.

4 participants