Interrupt deadlocked test with stack traces.

已回答

I'm running a complex server, full of concurrency, and occasionally I get into a deadlock -- a maybe a test waiting for some message that never happens. The test runs a client/server in one process, listening to a socket, so Go doesn't realized the deadlock.

Now, usually those are easy to identify with the stack trace: on the terminal I do a `kill -s QUIT` on the process et voila'. Unfortunately the Stop button on the test in GoLand sends, I believe, a `kill -9` to the process (?).

Is there a way to tell GoLand to interrupt the test with a `kill -s QUIT` instead ?

Or is there another way to get the stack traces of the current goroutines ?

Many thanks in advance for any help!

0

You can use the debugger and dump the current goroutines, please see: https://www.jetbrains.com/help/go/examining-suspended-program.html#filter-a-list-of-goroutines-in-the-dump-tab

Also, feel free to follow GO-10559 to support the ability to send a signal to a process launched from IDE.

0

请先登录再写评论。