From: Matt Joiner Date: Thu, 7 Aug 2025 05:48:06 +0000 (+1000) Subject: TODO on stat atomics being out of sync X-Git-Tag: v1.59.0~2^2~35 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=2cf7a4e1fc4fffa750462e1eb848beca0072d7b9;p=btrtrc.git TODO on stat atomics being out of sync --- diff --git a/webseed-peer.go b/webseed-peer.go index cf3a9e01..852716ab 100644 --- a/webseed-peer.go +++ b/webseed-peer.go @@ -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