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

[v23.3.x] http: Fix double call to stop() in http::client #18696

Merged
merged 1 commit into from
May 29, 2024

Conversation

graphcareful
Copy link
Contributor

@graphcareful graphcareful commented May 29, 2024

Backport of #18304

  • http::client::stop() can be called twice in the event the client is used via the with_client method.

  • The method had unconditionally called stop() in a finally clause with the intention to have users not have to manually do this and forget to call stop.

  • However stop() can also be called within certain exception handlers within methods invoked by http::client, ones that handle tls::verification_error exceptions.

  • This patch adds a boolean to our http client so that stop() can early exit if it has already been called.

Fixes: https://redpandadata.atlassian.net/browse/CORE-2932

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.1.x
  • v23.3.x
  • v23.2.x

Release Notes

Bug Fixes

  • Fixes a bug where crashes within the redpanda http client could occur when encountering tls exceptions

- http::client::stop() can be called twice in the event the client is
used via the `with_client` method.

- The method had unconditionally called stop() in a finally clause with
the intention to have users not have to manually do this and forget to
call stop.

- However stop() can also be called within certain exception handlers
within methods invoked by http::client, ones that handle
tls::verification_error exceptions.

- This patch adds a boolean to our http client so that stop() can early
exit if it has already been called.

(cherry picked from commit 2ed203d)
@graphcareful
Copy link
Contributor Author

graphcareful commented May 29, 2024

Will resolve #18427

@graphcareful graphcareful changed the title http: Fix double call to stop() in http::client [v23.3.x] http: Fix double call to stop() in http::client May 29, 2024
Copy link
Contributor

@michael-redpanda michael-redpanda left a comment

Choose a reason for hiding this comment

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

This is a backport from another PR right? This looks familiar

@graphcareful
Copy link
Contributor Author

Yeah, updating cover letter

@graphcareful graphcareful merged commit 4f21e26 into redpanda-data:v23.3.x May 29, 2024
21 checks passed
@BenPope BenPope added this to the v23.3.17 milestone Jun 26, 2024
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