Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.concurrency

Do not forget spawned task handles

Forgetting a JoinHandle leaks the task and drops panic propagation.

#Metadata

Rule ID
rust.correctness.forget-join-handle
Severity
medium
Confidence
0.85
Languages
rust
Presets
strict
Stability
stable
Applies to
block
Tags
concurrency, correctness, rules-catalog, rust

#Why it matters

`std::mem::forget` on a `tokio::spawn` return value or `JoinHandle` abandons the task without awaiting completion or observing panics.

#Remediation

Store the `JoinHandle`, await it, or use a structured shutdown path.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/rust/rust.correctness.forget-join-handle.rule.yaml.