sftp: don't retry permanent connection errors
The connection pacer in getSftpConnection used to retry every error, so permanent failures (host key mismatch, certificate rejection, auth failure, etc.) were looped 10 times before reporting to the user. Switch to using fserrors.ShouldRetry which matches the pattern other backends use so only genuinely retriable errors (timeouts, EOF, network blips) are retried and permanent errors are surfaced immediately.
This commit is contained in:
@@ -824,7 +824,7 @@ func (f *Fs) getSftpConnection(ctx context.Context) (c *conn, err error) {
|
||||
err = f.pacer.Call(func() (bool, error) {
|
||||
c, err = f.sftpConnection(ctx)
|
||||
if err != nil {
|
||||
return true, err
|
||||
return fserrors.ShouldRetry(err), err
|
||||
}
|
||||
return false, nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user