mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
The journal.setupWriter and journal.close calls in TxTracker.loop
are not protected by tracker.mu, while recheck and TrackAll access
journal.writer under the same mutex. This causes a data race
between the loop goroutine and callers of recheck/TrackAll.
Hold tracker.mu around setupWriter and close in loop to
synchronize access to journal.writer.
Fixes a race detected by go test -race:
Write at journal.setupWriter (journal.go:134)
by goroutine running TxTracker.loop
Previous read at journal.rotate (journal.go:154)
by goroutine running TxTracker.recheck
|
||
|---|---|---|
| .. | ||
| blobpool | ||
| legacypool | ||
| locals | ||
| errors.go | ||
| reserver.go | ||
| subpool.go | ||
| txpool.go | ||
| validation.go | ||
| validation_test.go | ||