Skip to content

[bitswap/peermanager] take read-lock for read-only operation - #755

Merged
gammazero merged 2 commits into
mainfrom
fix-read-lock-for-rdony-op
Dec 16, 2024
Merged

gammazero merged 2 commits into
mainfrom
fix-read-lock-for-rdony-op

Conversation

@gammazero

@gammazero gammazero commented Dec 14, 2024 •

Copy link
Copy Markdown
Contributor

Previously a read-only PeerManager operation was was protected by write-lock. This could have caused for the operation to block unnecessarily waiting for a write-lock.

There was also an instance of this with the PeerManager's session lock.

Previously a read-only operations was was protected by write-lock. This could have caused for the operation to block unnecessarily waiting for a write-lock.
@gammazero
gammazero requested a review from a team as a code owner December 14, 2024 10:43
@codecov

codecov Bot commented Dec 14, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 60.43%. Comparing base (2a26bf9) to head (274f634).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...tswap/client/internal/session/sessionwantsender.go 0.00% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #755      +/-   ##
==========================================
+ Coverage   60.32%   60.43%   +0.10%     
==========================================
  Files         245      245              
  Lines       31115    31112       -3     
==========================================
+ Hits        18771    18802      +31     
+ Misses      10670    10642      -28     
+ Partials     1674     1668       -6     
Files with missing lines Coverage Δ
bitswap/client/internal/peermanager/peermanager.go 91.85% <100.00%> (ø)
...tswap/client/internal/session/sessionwantsender.go 96.94% <0.00%> (+0.91%) ⬆️

... and 12 files with indirect coverage changes

@gammazero
gammazero merged commit 8d6ac57 into main Dec 16, 2024
@gammazero
gammazero deleted the fix-read-lock-for-rdony-op branch December 16, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants