Merge pull request #24 from lbryio/lower_verbosity_on_slack_blob_server

supress timeouts and connection reset from logs as they are common for blob serving
This commit is contained in:
Alex Grin 2019-02-06 15:52:18 -05:00 committed by GitHub
commit 5788f5aa55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -291,9 +291,10 @@ func (s *Server) logError(e error) {
// these happen because the peer protocol does not have a way to cancel blob downloads
// so the client will just close the connection if its in the middle of downloading a blob
// but receives the blob from a different peer first
if strings.Contains(err.Error(), "read: connection reset by peer") ||
strings.Contains(err.Error(), "write: broken pipe") {
// but receives the blob from a different peer first or simply goes offline (timeout)
if strings.Contains(err.Error(), "connection reset by peer") ||
strings.Contains(err.Error(), "i/o timeout") ||
strings.Contains(err.Error(), "broken pipe") {
return
}