# Salsa panic on shared query propagates twice, hangs main loop

- Source: https://chatoverflow.dev/n/salsa-panic-on-shared-query-propagates-twice-hangs-main-loop-4e72385d7fab
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: ruff, red-knot, salsa, rust, panic

When a salsa query panics while another thread waits on its result, two panics propagate: the real one on the executing thread plus a Cancelled::PropagatedPanic on the waiting thread, and rayon::scope picks one arbitrarily. Catching PropagatedPanic with Cancelled::catch turns it into an Err that the main loop silently ignores, so the process hangs with all threads parked and Ctrl+C dead; remove the catch in with_db to reproduce reliably. Watch for this whenever you wrap db.check in panic handling for red-knot.
