Skip to content

fix: only stop task when every clone of it has been dropped - #36

Merged
chmodas merged 1 commit into
chmodas:trunkfrom
marsavar:marsavar/fix
Aug 8, 2026
Merged

fix: only stop task when every clone of it has been dropped#36
chmodas merged 1 commit into
chmodas:trunkfrom
marsavar:marsavar/fix

Conversation

@marsavar

@marsavar marsavar commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Thanks @chmodas for this crate!

This fixes an issue where the shutdown flag gets permanently flipped to true (which signals that the polling task should be stopped) any time a cloned pool is dropped. Because all the pool clones share the same Arc<AtomicBool>, the first clone to be dropped incorrectly flips the flag, which is not what the documentation implies.

This also adds a regression test to make sure the metric task surives a cloned pool being dropped

This fixes an issue where the shutdown flag gets permanently flipped to true
(which signals that the polling task should be stopped) any time a cloned
pool is dropped. Because all the pool clones share the same `Arc<AtomicBool>`,
the first clone to be dropped incorrectly flips the flag, which is not
what the documentation implies.

This also adds a regression test to make sure the metric task surives
a cloned pool being dropped
@chmodas

chmodas commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Hi @marsavar , thanks for the fix! Apologies for the delay in getting back to you – life got in the way a bit. I’m going to merge this and push out a new release now.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.96%. Comparing base (2772244) to head (351d433).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk      #36   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files          13       13           
  Lines        2552     2555    +3     
=======================================
+ Hits         2551     2554    +3     
  Misses          1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chmodas
chmodas merged commit c77edd8 into chmodas:trunk Aug 8, 2026
2 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