News for hackers. Stuff that matters.
Re:What could Go wrong with a mutex by gnfargbl on Wednesday November 03, 2021 @06:38AM (#29092918)
One way I often debug this kind of problem is to use go's built-in pprof tooling. You can insert a profiling server into your program in four lines: https://pkg.go.dev/net/http/pprof. Then, do something like

    go tool pprof 'http://127.0.0.1:6060/debug/pprof/goroutine?debug=1'
to get a goroutine profile of your running program, and use the web command to display it in a browser as a DAG. The stuck goroutine can usually be seen pretty easily on the graph.

There are no comments on this comment yet.