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

add synchronization comment to handle_new_root #19571

Merged
merged 2 commits into from
Sep 2, 2021

Conversation

jbiseda
Copy link
Contributor

@jbiseda jbiseda commented Sep 2, 2021

Problem

handle_new_root() acquires a write lock on bank_forks, drops the lock, acquires a read lock, and looks up the new_root added under the write lock. Because bank_forks is only updated by a single thread this is safe. See: fix race in handle_new_root #18984

Summary of Changes

Add a comment to describe why this is safe.

@jbiseda jbiseda requested a review from carllin September 2, 2021 00:46
carllin
carllin previously approved these changes Sep 2, 2021
@mergify mergify bot dismissed carllin’s stale review September 2, 2021 18:20

Pull request has been modified.

@codecov
Copy link

codecov bot commented Sep 2, 2021

Codecov Report

Merging #19571 (10908e9) into master (f4f14c4) will increase coverage by 0.0%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #19571   +/-   ##
=======================================
  Coverage    82.5%    82.5%           
=======================================
  Files         468      468           
  Lines      131542   131542           
=======================================
+ Hits       108540   108570   +30     
+ Misses      23002    22972   -30     

@jbiseda jbiseda merged commit 7a8eba1 into solana-labs:master Sep 2, 2021
@jbiseda jbiseda deleted the handle_new_root_comment branch September 2, 2021 20:52
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Sep 2, 2021
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Sep 3, 2021
frits-metalogix added a commit to identity-com/solana that referenced this pull request Nov 24, 2021
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.

2 participants