Commit 791332c
core: improve shutdown synchronization in BlockChain (ethereum#22853)
This change removes misuses of sync.WaitGroup in BlockChain. Before this change,
block insertion modified the WaitGroup counter in order to ensure that Stop would wait
for pending operations to complete. This was racy and could even lead to crashes
if Stop was called at an unfortunate time. The issue is resolved by adding a specialized
'closable' mutex, which prevents chain modifications after stopping while also
synchronizing writers with each other.
Co-authored-by: Felix Lange <fjl@twurst.com>1 parent 5fd23a6 commit 791332c
File tree
3 files changed
+164
-61
lines changed- core
- internal/syncx
3 files changed
+164
-61
lines changed
0 commit comments