From: Matt Joiner Date: Tue, 6 May 2025 02:17:36 +0000 (+1000) Subject: Lower log level for peer upload read errors when Torrent is closed X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=1e3f1bf041caed8db098ee899d0625b599a98f47;p=btrtrc.git Lower log level for peer upload read errors when Torrent is closed Fixes #980. --- diff --git a/peerconn.go b/peerconn.go index 2a3fd947..27fa820f 100644 --- a/peerconn.go +++ b/peerconn.go @@ -673,9 +673,11 @@ func (c *PeerConn) peerRequestDataReader(r Request, prs *peerRequestState) { func (c *PeerConn) peerRequestDataReadFailed(err error, r Request) { torrent.Add("peer request data read failures", 1) logLevel := log.Warning - if c.t.hasStorageCap() { + if c.t.hasStorageCap() || c.t.closed.IsSet() { // It's expected that pieces might drop. See - // https://github.com/anacrolix/torrent/issues/702#issuecomment-1000953313. + // https://github.com/anacrolix/torrent/issues/702#issuecomment-1000953313. Also the torrent + // may have been Dropped, and the user expects to own the files, see + // https://github.com/anacrolix/torrent/issues/980. logLevel = log.Debug } c.logger.Levelf(logLevel, "error reading chunk for peer Request %v: %v", r, err)