Skip to content

Commit

Permalink
time: panic in release mode when mark_pending called when the timer…
Browse files Browse the repository at this point in the history
… entry is deregistered or in pending fire
  • Loading branch information
cjwcommuny committed Oct 11, 2022
1 parent 992a168 commit 3235ccd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tokio/src/runtime/time/entry.rs
Expand Up @@ -172,7 +172,9 @@ impl StateCell {
let mut cur_state = self.state.load(Ordering::Relaxed);

loop {
debug_assert!(cur_state < STATE_MIN_VALUE);
// improve the error message for things like
// https://github.com/tokio-rs/tokio/issues/3675
assert!(cur_state < STATE_MIN_VALUE, "mark_pending called when the timer entry is deregistered or in pending fire");

if cur_state > not_after {
break Err(cur_state);
Expand Down

0 comments on commit 3235ccd

Please sign in to comment.