cygrunsrv + sshd + rsync = 20 times too slow -- throttled?

Takashi Yano takashi.yano@nifty.ne.jp
Mon Sep 6 23:39:29 GMT 2021


On Mon, 6 Sep 2021 18:08:54 +0200
Corinna Vinschen wrote:
> On Sep  6 22:16, Takashi Yano wrote:
> > Current git head seems to have some bug. With and without my patch,
> > sftp get for large file causes error:
> > 
> > [yano@Express5800-S70 ~]$ sftp 192.168.0.133
> > yano@192.168.0.133's password:
> > Connected to 192.168.0.133.
> > sftp> get test.dat
> > Fetching /home/yano/test.dat to test.dat
> > test.dat                                       13%   66MB  66.4MB/s   00:06 ETAReceived message too long 1728053256
> > Ensure the remote shell produces no output for non-interactive sessions.
> > [yano@Express5800-S70 ~]$ sftp 192.168.0.133
> > yano@192.168.0.133's password:
> > Connected to 192.168.0.133.
> > sftp> get test.dat
> > Fetching /home/yano/test.dat to test.dat
> > test.dat                                       22%  111MB 110.6MB/s   00:03 ETAdo_download: parse: incomplete message
> > [yano@Express5800-S70 ~]$
> 
> I bisected this down to commit 296bd3e78b52, but I'm at a loss in
> terms of the cause of the problem, ATM.

Thanks for bisecting this.

I am not sure this is the correct thing, however, found the following
patch solves the issue.

diff --git a/winsup/cygwin/fhandler_pipe.cc b/winsup/cygwin/fhandler_pipe.cc
index 76ce895e2..83efb8296 100644
--- a/winsup/cygwin/fhandler_pipe.cc
+++ b/winsup/cygwin/fhandler_pipe.cc
@@ -292,7 +292,7 @@ fhandler_pipe::raw_read (void *ptr, size_t& len)
                           len1, NULL, NULL);
       if (evt && status == STATUS_PENDING)
        {
-         waitret = cygwait (evt, INFINITE, cw_cancel | cw_sig);
+         waitret = cygwait (evt, INFINITE, cw_cancel | cw_sig_restart);
          if (waitret == WAIT_OBJECT_0)
            status = io.Status;
        }
@@ -442,7 +442,7 @@ fhandler_pipe_fifo::raw_write (const void *ptr, size_t len)
        }
       if (evt && status == STATUS_PENDING)
        {
-         waitret = cygwait (evt, INFINITE, cw_cancel | cw_sig);
+         waitret = cygwait (evt, INFINITE, cw_cancel | cw_sig_restart);
          if (waitret == WAIT_OBJECT_0)
            status = io.Status;
        }

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>


More information about the Cygwin-developers mailing list