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

network: fix publicKeyIdentTracker data race in hybrid mode #6110

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

algorandskiy
Copy link
Contributor

Summary

Fix data race in hybrid mode when a shared publicKeyIdentTracker.peersByID is accessed from both p2p and ws net instances - added a mutex to publicKeyIdentTracker. Since net identity is called only on connect/disconnect (i.e. not very frequent), mutex is OK to use.

Test Plan

Existing tests

@algorandskiy algorandskiy added Bug-Fix p2p Work related to the p2p project labels Aug 23, 2024
@algorandskiy algorandskiy self-assigned this Aug 23, 2024
Copy link

codecov bot commented Aug 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.25%. Comparing base (8e2e2e4) to head (6dd7fd4).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6110      +/-   ##
==========================================
+ Coverage   56.22%   56.25%   +0.03%     
==========================================
  Files         490      490              
  Lines       69705    69710       +5     
==========================================
+ Hits        39191    39217      +26     
+ Misses      27840    27822      -18     
+ Partials     2674     2671       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@gmalouf gmalouf left a comment

Choose a reason for hiding this comment

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

Makes sense

@algorandskiy algorandskiy merged commit 4990077 into algorand:master Aug 26, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug-Fix p2p Work related to the p2p project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants