Skip to content

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

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