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

Fix coroutine leak #7821

Merged
merged 7 commits into from
Oct 15, 2024
Merged

Fix coroutine leak #7821

merged 7 commits into from
Oct 15, 2024

Conversation

fpetkovski
Copy link
Contributor

The in-process client uses a pull based iterator which needs to be closed, otherwise it will leak the underlying coroutine. When this happens, the tsdb reader will remain open which blocks head compaction indefinitely.

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Verification

The in-process client uses a pull based iterator which needs
to be closed, otherwise it will leak the underlying coroutine.
When this happens, the tsdb reader will remain open which blocks head
compaction indefinitely.

Signed-off-by: Filip Petkovski <[email protected]>
Copy link
Contributor

@pedro-stanaka pedro-stanaka left a comment

Choose a reason for hiding this comment

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

LG - Let's add CHANGELOG? A bug fix, is a bug fix 🙂

@pull-request-size pull-request-size bot added size/L and removed size/M labels Oct 14, 2024
Signed-off-by: Filip Petkovski <[email protected]>
Signed-off-by: Filip Petkovski <[email protected]>
Signed-off-by: Filip Petkovski <[email protected]>
@fpetkovski
Copy link
Contributor Author

Added a changelog entry and some better tests to catch leaks.

Signed-off-by: Filip Petkovski <[email protected]>
MichaHoffmann
MichaHoffmann previously approved these changes Oct 14, 2024
Signed-off-by: Filip Petkovski <[email protected]>
Signed-off-by: Filip Petkovski <[email protected]>
@MichaHoffmann MichaHoffmann merged commit 9c925bf into thanos-io:main Oct 15, 2024
22 checks passed
jnyi pushed a commit to jnyi/thanos that referenced this pull request Oct 17, 2024
* Fix coroutine leak

The in-process client uses a pull based iterator which needs
to be closed, otherwise it will leak the underlying coroutine.
When this happens, the tsdb reader will remain open which blocks head
compaction indefinitely.

Signed-off-by: Filip Petkovski <[email protected]>

* Fix race condition

Signed-off-by: Filip Petkovski <[email protected]>

* Fix CHANGELOG

Signed-off-by: Filip Petkovski <[email protected]>

* Improve tests

Signed-off-by: Filip Petkovski <[email protected]>

* Fix blockSeriesClient

Signed-off-by: Filip Petkovski <[email protected]>

* Fix unit test

Signed-off-by: Filip Petkovski <[email protected]>

* Fix another unit test

Signed-off-by: Filip Petkovski <[email protected]>

---------

Signed-off-by: Filip Petkovski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants