Runtime can detect goroutines blocked on unreachable chans/mutexes/etc and report such
This needs an interface in http/pprof to query zombie goroutines on running services.
And probably testing package integration to test for absence of zombie goroutines.
The text was updated successfully, but these errors were encountered:
The idea is as follows:
Do GC-like scan of memory, but do not consider stacks of goroutines blocked on channels
as roots. If a channel is marked as reachable, make all goroutines blocked on it as
reachable and include their stacks into roots. At the end of the scan goroutines not
marked as reachable are reported as dead.
This can be extended to other synchronization primitives and timers (timer which Time
chan is not reachable other than from the timer is dead).