Commit a36f84d
Fix mdbx async tx goroutine leak: buffer the result channel
When asyncTx.Apply/asyncRwTx.Apply/ApplyRw is called, it creates an
unbuffered result channel (rc), sends a request to the mdbx thread, and
waits in a select for either the result or ctx.Done(). If the context is
cancelled while the mdbx thread is executing the function, the caller
takes the ctx.Done() path and abandons rc. The mdbx thread then tries to
send the result to the unbuffered rc, but nobody is reading — blocking
the mdbx-locked goroutine forever.
This manifests as exec3_parallel.go:180 stuck on "chan send" for the
entire test timeout (56+ minutes), with the mdbx thread permanently
locked.
Fix: make rc buffered with capacity 1 so the mdbx thread can always
complete its send even if the caller has abandoned the channel.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 058e084 commit a36f84d
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
822 | | - | |
| 822 | + | |
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
| |||
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
846 | | - | |
| 846 | + | |
847 | 847 | | |
848 | 848 | | |
849 | 849 | | |
| |||
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
857 | | - | |
| 857 | + | |
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
| |||
0 commit comments