Skip to content

network: fix publicKeyIdentTracker data race in hybrid mode#6110

Merged
algorandskiy merged 1 commit intoalgorand:masterfrom
algorandskiy:pavel/test-dedup-fix
Aug 26, 2024
Merged

network: fix publicKeyIdentTracker data race in hybrid mode#6110
algorandskiy merged 1 commit intoalgorand:masterfrom
algorandskiy:pavel/test-dedup-fix

Conversation

@algorandskiy
Copy link
Copy Markdown
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 requested review from cce and gmalouf August 23, 2024 19:01
@algorandskiy algorandskiy self-assigned this Aug 23, 2024
@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
@algorandskiy algorandskiy deleted the pavel/test-dedup-fix branch March 16, 2026 20:06
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