From fe1aa13069866380171da8587356efd46f42cc57 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 3 Apr 2021 11:32:46 +0100 Subject: [PATCH] sftp: revert sftp library to v1.12.0 from v1.13.0 to fix performance regression #5197 This reverts the library update done in this commit. 713f8f357dc5eb51 sftp: fix "file not found" errors for read once servers Reverting this commit triples the performance to a far away sftp server. See: https://github.com/pkg/sftp/issues/426 --- backend/sftp/sftp.go | 6 +++++- go.mod | 2 +- go.sum | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/sftp/sftp.go b/backend/sftp/sftp.go index 2c9e24322..0dee508c6 100644 --- a/backend/sftp/sftp.go +++ b/backend/sftp/sftp.go @@ -395,8 +395,12 @@ func (f *Fs) newSftpClient(conn *ssh.Client, opts ...sftp.ClientOption) (*sftp.C opts = opts[:len(opts):len(opts)] // make sure we don't overwrite the callers opts opts = append(opts, sftp.UseFstat(f.opt.UseFstat), - sftp.UseConcurrentReads(!f.opt.DisableConcurrentReads), + // FIXME disabled after library reversion + // sftp.UseConcurrentReads(!f.opt.DisableConcurrentReads), ) + if f.opt.DisableConcurrentReads { // FIXME + fs.Errorf(f, "Ignoring disable_concurrent_reads after library reversion - see #5197") + } return sftp.NewClientPipe(pr, pw, opts...) } diff --git a/go.mod b/go.mod index 1e56ccd3d..bf96775a3 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( github.com/nsf/termbox-go v0.0.0-20210114135735-d04385b850e8 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/errors v0.9.1 - github.com/pkg/sftp v1.13.0 + github.com/pkg/sftp v1.12.0 github.com/prometheus/client_golang v1.9.0 github.com/prometheus/procfs v0.3.0 // indirect github.com/putdotio/go-putio/putio v0.0.0-20200123120452-16d982cac2b8 diff --git a/go.sum b/go.sum index cc9093cb8..c7a7f7c48 100644 --- a/go.sum +++ b/go.sum @@ -504,6 +504,8 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.12.0 h1:/f3b24xrDhkhddlaobPe2JgBqfdt+gC/NYl0QY9IOuI= +github.com/pkg/sftp v1.12.0/go.mod h1:fUqqXB5vEgVCZ131L+9say31RAri6aF6KDViawhxKK8= github.com/pkg/sftp v1.13.0 h1:Riw6pgOKK41foc1I1Uu03CjvbLZDXeGpInycM4shXoI= github.com/pkg/sftp v1.13.0/go.mod h1:41g+FIPlQUTDCveupEmEA65IoiQFrtgCeDopC4ajGIM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -695,6 +697,7 @@ golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=