Skip to content

Commit cd53e86

Browse files
author
Darioush Jalali
authored
snapshot: fix race in abort/generate (#1155)
1 parent 7893288 commit cd53e86

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/state/snapshot/snapshot.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,9 @@ func (t *Tree) AbortGeneration() {
568568
// for it to shutdown before returning (if it is running). This call should not
569569
// be made concurrently.
570570
func (dl *diskLayer) abortGeneration() bool {
571+
dl.lock.Lock()
572+
defer dl.lock.Unlock()
573+
571574
// Store ideal time for abort to get better estimate of load
572575
//
573576
// Note that we set this time regardless if abortion was skipped otherwise we

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax
5858
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
5959
github.com/ava-labs/avalanchego v1.11.3 h1:Fgf2R46SFsbe3dbaCu0vFPaA8F1zMqdf6Y/NYjG/wcA=
6060
github.com/ava-labs/avalanchego v1.11.3/go.mod h1:ruzSPKSH8GBFegvNsnKerD8+8oVnkJ5ejRAOUQ4pAZU=
61-
github.com/ava-labs/coreth v0.13.2-rc.2 h1:GmXSyDykDUuDyW7933T8lK7Fp6/4k/IcHhLJjkvjUYI=
62-
github.com/ava-labs/coreth v0.13.2-rc.2/go.mod h1:jOapwtgvroqZ2U8PJpoaq1PHrUFOrlgshUWQfM3nba0=
6361
github.com/ava-labs/coreth v0.13.3-0.20240326002912-83b1aa1c7a43 h1:CR0HAG6CYakCyxibAmehCDyjvyriWt2pSxhmDR8MrKk=
6462
github.com/ava-labs/coreth v0.13.3-0.20240326002912-83b1aa1c7a43/go.mod h1:n128DRgabYrCAUsGEXOKP0uzBLSV37zGIGs7xTAQZDY=
6563
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=

0 commit comments

Comments
 (0)