3 ms·
This is indeed a nice feature, but it's worth pointing out that if any goroutine can make progress, the deadlock will be missed. For example, if you launched a
by ridiculous_fish 14y ago
This is indeed a nice feature, but it's worth pointing out that if any goroutine can make progress, the deadlock will be missed.
For example, if you launched a task to do some work in the background, and the task deadlocks with one of its own goroutines or even itself (e.g. reads and writes on the same channel), this deadlock will not be reported.
In a large system with many goroutines, I think it is more likely to have a deadlock within a component instead of process-wide, and these will not be reported. (Yet!)
- ominous_prime 14y agoYes, I should have emphasized "usually". I also locked up a program by inadvertently creating a small goroutine with a busy-loop (the typo being time.Sleep(1)). That little loop prevented any other goroutines from getting scheduled, though it wasn't hard to deduce what was happening, since the CPU was running at 100%.