Open
Description
I am frequently encountering this in tests involving multiple SDK apps in the same process, on iavl tag v1.3.2. I am working with the latest cosmos-sdk commit, where async pruning is fixed to true.
The relevant code snippets are:
Lines 1122 to 1129 in d89d5d2
and
Lines 599 to 608 in d89d5d2
(*nodeDB).startPruning
runs in its own goroutine, created during newNodeDB
. (*nodeDB).Close
is called on a separate goroutine, e.g. from closing an SDK commitment store. Flow during the deadlock happens as follows:
- The
Close
goroutine acquires the lock onndb.mtx
- Concurrently, the
startPruning
goroutine enters the default case and attempts to callndb.mtx.Lock()
, but it cannot acquire the lock until theClose
goroutine releases it - Therefore, the
Close
goroutine is blocked reading fromndb.done
because thestartPruning
goroutine cannot advance past acquiring the lock
Metadata
Metadata
Assignees
Labels
No labels