Skip to content

fix: fix dataraces in testlog and snap sync test (ethereum#29301) - #112

Merged
hmlee-wm merged 1 commit into
devfrom
fix/testlog-snap-sync-test-data-race
Jul 14, 2026
Merged

hmlee-wm merged 1 commit into
devfrom
fix/testlog-snap-sync-test-data-race

Conversation

@hmlee-wm

Copy link
Copy Markdown
Collaborator

Summary

Backports ethereum/go-ethereum#29301, which fixes two data races reported by go test -race ./....

Upstream References

PR Description
#29301 eth/protocols/snap, internal/testlog: fix dataraces

Changes

  • internal/testlog/testlog.go: add a sync.Mutex to bufHandler and guard Handle, WithAttrs, and flush so that concurrent access to the shared record buffer is serialized.
  • eth/protocols/snap/sync_test.go: remove t.Parallel() from TestSyncAccountPerformance because it mutates the global var accountConcurrency.

(cherry picked from commit 04bf1c802ffe9dfc34c34b3e666ee15e96b4a203)
@hmlee-wm
hmlee-wm requested review from 0xmhha, colinkim and eomti-wm July 13, 2026 11:46
@hmlee-wm hmlee-wm self-assigned this Jul 13, 2026
@hmlee-wm hmlee-wm added the bug Something isn't working label Jul 13, 2026

@0xmhha 0xmhha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eomti-wm eomti-wm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hmlee-wm
hmlee-wm merged commit 7725aae into dev Jul 14, 2026
3 checks passed
@hmlee-wm
hmlee-wm deleted the fix/testlog-snap-sync-test-data-race branch July 20, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants