Skip to content

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

Open
marsavar wants to merge 1 commit into
chmodas:trunkfrom
marsavar:marsavar/fix
Open

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

Conversation

@marsavar

@marsavar marsavar commented Jul 20, 2026

Copy link
Copy Markdown

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
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.

1 participant