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

rptest/kgo: avoid extra wait on shutdown #21358

Merged

Conversation

nvartolomei
Copy link
Contributor

There are 2 ways to stop a kgo service. One is graceful shutdown and another one is hard stop. We use 2 threading.Event objects to signal this.

Before this change, the polling thread would only wait on the _stop_requested and if it was set or if a timeout is hit (self.INTERVAL=5s) it would run the loop again and check if stop or shutdown was requested.

This leads for shutdown taking 5s more than it should in worst case.

We avoid this extra wait but settling on a single threading.Event object (_shutdown_requested) for signaling that the loop should run again. Then we signal that event from both, shutdown and hard stop.

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

  • none

There are 2 ways to stop a kgo service. One is graceful shutdown and
another one is hard stop. We use 2 `threading.Event` objects to signal
this.

Before this change, the polling thread would only wait on the
`_stop_requested` and if it was set or if a timeout is hit
(self.INTERVAL=5s) it would run the loop again and check if stop or
shutdown was requested.

This leads for shutdown taking 5s more than it should in worst case.

We avoid this extra wait but settling on a single threading.Event object
(_shutdown_requested) for signaling that the loop should run again. Then
we signal that event from both, shutdown and hard stop.
@vbotbuildovich
Copy link
Collaborator

vbotbuildovich commented Jul 12, 2024

skipped ducktape retry in https://buildkite.com/redpanda/redpanda/builds/51413#0190a78a-792e-40b3-a8cc-30190e43a9f3:
pandatriage cache was not found

skipped ducktape retry in https://buildkite.com/redpanda/redpanda/builds/51413#0190a78a-7930-4093-8c70-71b348a0d2d0:
pandatriage cache was not found

@nvartolomei
Copy link
Contributor Author

@nvartolomei nvartolomei requested review from dotnwat and Lazin July 12, 2024 18:13
Copy link
Member

@dotnwat dotnwat left a comment

Choose a reason for hiding this comment

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

excellent cover letter write up. thanks!

@dotnwat dotnwat merged commit 7fc634a into redpanda-data:dev Jul 12, 2024
14 of 17 checks passed
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.

3 participants