]> Sergey Matveev's repositories - btrtrc.git/commitdiff
TODO on stat atomics being out of sync
authorMatt Joiner <anacrolix@gmail.com>
Thu, 7 Aug 2025 05:48:06 +0000 (15:48 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 7 Aug 2025 05:48:06 +0000 (15:48 +1000)
webseed-peer.go

index cf3a9e0109b1f6f2e84fa6ce6687b45ea875ee53..852716ab86073dae2d25c4ba9beae8b4efa2a7e0 100644 (file)
@@ -302,6 +302,8 @@ func (ws *webseedPeer) readChunks(wr *webseedRequest) (err error) {
                        err = fmt.Errorf("reading chunk: %w", err)
                        return
                }
+               // TODO: This happens outside Client lock, and stats can be written out of sync with each
+               // other. Why even bother with atomics?
                ws.peer.doChunkReadStats(int64(n))
                // TODO: Clean up the parameters for receiveChunk.
                msg.Piece = buf