Show HN: Deadlog – almost drop-in mutex for debugging Go deadlocks
30 points| dirteater_ | 19 days ago |github.com
With some `runtime.Callers` I can usually find the spot by just swapping the existing Mutex or RWMutex for this one.
Sometimes I switch the
mu.Lock()
defer mu.Unlock()
with the LockFunc/RLockFunc to get more detail defer mu.LockFunc()()
I almost always initialize it with `deadlog.New(deadlog.WithTrace(1))` and that's plenty.Not the most polished library, but it's not supposed to land in any commit, just a temporary debugging aid. I find it useful.
fractorial|19 days ago
[1] https://go.dev/blog/synctest
egedev|14 days ago
[deleted]
unknown|19 days ago
[deleted]