Skip to content

Commit

Permalink
internal/cache: dump goroutines in cache entry leak error
Browse files Browse the repository at this point in the history
  • Loading branch information
jbowens committed Dec 12, 2024
1 parent f4e9e04 commit cb24a4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/cache/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ func entryAllocNew() *entry {
invariants.SetFinalizer(e, func(obj interface{}) {
e := obj.(*entry)
if *e != (entry{}) {
fmt.Fprintf(os.Stderr, "%p: entry was not freed", e)
buf := make([]byte, 256<<10)
n := runtime.Stack(buf, true)
fmt.Fprintf(os.Stderr, "%p: entry was not freed\n%s", e, string(buf[:n]))
os.Exit(1)
}
})
Expand Down

0 comments on commit cb24a4f

Please sign in to comment.