Situation:
I have a race condition problem in my Go server program:
go func() {
i := 1
for {
fmt.Printf("I am alive: %d
",i)
time.Sleep(1 * time.Second)
i+=1
}
}()
After lots of parallel requests to my program, it completely hangs up, and even the goroutine in main does not write anything more.
Question:
I want to eliminate this problem. For that, I want to produce a panic
in this state and receive a stack dump of all goroutines.
Is there any way to do this?