Commit b14abfc
fix: race condition on connIdIssued in Client.request (#1039)
* fix: race condition on connIdIssued in Client.request
The write to connIdIssued on error response (Connection ID mismatch)
was not protected by the client mutex, racing with concurrent
requestWriter goroutines that read connIdIssued via writeRequest ->
connect -> shouldReconnect (which do hold the lock).
Fixes erigontech/erigon#18901
* Update the golangci-lint workflow
I followed the instructions at https://github.com/golangci/golangci-lint-action.
* fix: data race in BenchmarkConnectionMainReadLoop (#1040)
_pendingPieces.Add(0) was called without holding the client lock and
without updating the piece request order, causing two issues:
1. Data race with timer goroutines accessing the roaring bitmap
2. Panic in checkPendingPiecesMatchesRequestOrder due to _pendingPieces
and requestOrder being out of sync
Replace the direct bitmap manipulation with updatePiecePriority(0, ...)
which properly updates both _pendingPieces and the piece request order
while holding the client lock.
Co-authored-by: info@weblogix.biz <admin@10gbps.weblogix.it>
Co-authored-by: Matt Joiner <anacrolix@gmail.com>
---------
Co-authored-by: Matt Joiner <anacrolix@gmail.com>
Co-authored-by: info@weblogix.biz <admin@10gbps.weblogix.it>1 parent cc8650f commit b14abfc
File tree
0 file changed
+0
-0
lines changed0 file changed
+0
-0
lines changed
0 commit comments