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

Fix race condition on nodes table revalidation #69

Merged
merged 2 commits into from
Mar 24, 2025

Conversation

r4f4ss
Copy link
Contributor

@r4f4ss r4f4ss commented Mar 22, 2025

Fix #61 only on table_reval.go

I was not able to reproduce the race condition on portal_protocol.go and the file was modified since the issue report.

@GrapeBaBa GrapeBaBa requested a review from Copilot March 22, 2025 05:11
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a reported race condition affecting nodes table revalidation by introducing a new read/write mutex (ntLock) to protect access to the revalidationList's nextTime and nodes.

  • Added a new RWMutex (ntLock) within the revalidationList struct.
  • Updated the critical sections in the run, schedule, and remove functions to use the new lock for proper synchronization.
Comments suppressed due to low confidence (1)

portalwire/table_reval.go:251

  • [nitpick] In the remove function, the use of a write lock when updating nextTime is appropriate; please verify that all modifications related to nextTime throughout the file are consistently protected by ntLock.
list.ntLock.Lock()

@GrapeBaBa
Copy link
Member

@fearlessfe what is your change compare with this PR?

@GrapeBaBa
Copy link
Member

Thanks @r4f4ss

@GrapeBaBa GrapeBaBa merged commit 69aeabb into zen-eth:main Mar 24, 2025
6 checks passed
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.

DATA RACE
2 participants