From 6e853c82d8dc499bba2d20fa649e7d0aaaf95cef Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 9 Jul 2024 23:40:32 +0100 Subject: [PATCH] sftp: ignore errors when closing the connection pool There is no need to report errors when draining the connection pool - they are useless at this point. See: https://forum.rclone.org/t/rclone-fails-to-close-unused-tcp-connections-due-to-use-of-closed-network-connection/46735 --- backend/sftp/sftp.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/sftp/sftp.go b/backend/sftp/sftp.go index 28a71ea14..4fd88ab48 100644 --- a/backend/sftp/sftp.go +++ b/backend/sftp/sftp.go @@ -815,13 +815,13 @@ func (f *Fs) drainPool(ctx context.Context) (err error) { if cErr := c.closed(); cErr == nil { cErr = c.close() if cErr != nil { - err = cErr + fs.Debugf(f, "Ignoring error closing connection: %v", cErr) } } f.pool[i] = nil } f.pool = nil - return err + return nil } // NewFs creates a new Fs object from the name and root. It connects to