Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(beacon-chain): potential race to write callbacks #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mattevans
Copy link
Member

@mattevans mattevans commented Feb 7, 2025

tldr; running go test with -race is picking-up that this insn't thread-safe.


I'm writing some unrelated e2e tests for contributoor and was getting some unusual failures stemming from this pkg when running tests with -race.

This is not a problem for production right now, given how we typically use this pkg during initialization

Initially I thought this was related to our multi-beacon-node changes in contributoor:

  • Each MetadataService creates its own ethwallclock instance
  • Each instance has its own independent callback slices
  • There's no sharing of callbacks between instances
  • The race detector was catching races within individual instances, not between them. Isn't smart enough to tell the difference.

If you run go test -v -race ./... on master of this repo, you'll see the race's/failures in question.

I'd love to keep using -race across contributoor and other pkgs, so hence this PR.

@mattevans mattevans self-assigned this Feb 7, 2025
@mattevans mattevans marked this pull request as ready for review February 7, 2025 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants