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

time: panic in release mode when mark_pending called illegally #5093

Merged
merged 3 commits into from Oct 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion tokio/src/runtime/time/entry.rs
Expand Up @@ -172,7 +172,12 @@ 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 in an invalid state"
);

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