Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.resource-leak

Avoid unbounded async channels

Unbounded channels can grow without backpressure and exhaust memory.

#Metadata

Rule ID
rust.correctness.unbounded-channel
Severity
medium
Confidence
0.85
Languages
rust
Presets
strict
Stability
stable
Applies to
block
Tags
correctness, resource-leak, rules-catalog, rust

#Why it matters

`tokio::sync::mpsc::unbounded_channel` and `futures::channel::mpsc::unbounded` accept messages without capacity limits, which can cause unbounded memory growth under load.

#Remediation

Use a bounded `mpsc::channel` with an explicit capacity.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/rust/rust.correctness.unbounded-channel.rule.yaml.