← Rule catalog

rust-doctor · Framework

actix-blocking-handler

Flags blocking calls (`std::thread::sleep`, `std::fs::*`, `std::net::*`) in actix-web handler functions. Web framework handlers run on the async runtime and must not block.

Severity
warning
Confidence
medium
Analyzer
syn-ast
Default policy
Enabled

Tags

  • framework
  • heuristic

Framework requirements

  • actix-web >=4,<5

Limitations

  • Syntactic analysis does not have rustc name resolution or inferred type information.

Remediation

Use async equivalents (`tokio::time::sleep`, `tokio::fs::*`, `tokio::net::*`) or wrap blocking code in `actix_web::web::block()`.

Fix capability: guidance