cygrunsrv + sshd + rsync = 20 times too slow -- throttled?
Takashi Yano
takashi.yano@nifty.ne.jp
Wed Sep 15 10:48:58 GMT 2021
On Wed, 15 Sep 2021 11:57:44 +0200
Corinna Vinschen wrote:
> On Sep 15 09:59, Takashi Yano wrote:
> > @@ -633,17 +633,15 @@ pipe_data_available (int fd, fhandler_base *fh, HANDLE h, bool writing)
> > /* Note: Do not use NtQueryInformationFile() for query_hdl because
> > NtQueryInformationFile() seems to interfere with reading pipes
> > in non-cygwin apps. Instead, use PeekNamedPipe() here. */
>
> ...so we're not using NtQueryInformationFile on the query_hdl...
>
> > - if (fh->get_device () == FH_PIPEW)
> > + if (fh->get_device () == FH_PIPEW && fpli.WriteQuotaAvailable == 0)
> > {
> > HANDLE query_hdl = ((fhandler_pipe *) fh)->get_query_handle ();
> > - if (query_hdl)
> > - {
> > - DWORD nbytes_in_pipe;
> > - PeekNamedPipe (query_hdl, NULL, 0, NULL, &nbytes_in_pipe, NULL);
> > - fpli.WriteQuotaAvailable = fpli.InboundQuota - nbytes_in_pipe;
> > - }
> > - else
> > + if (!query_hdl)
> > + return 1; /* We cannot know actual write pipe space. */
> > + DWORD nbytes_in_pipe;
> > + if (!PeekNamedPipe (query_hdl, NULL, 0, NULL, &nbytes_in_pipe, NULL))
> > return 1;
> > + fpli.WriteQuotaAvailable = fpli.InboundQuota - nbytes_in_pipe;
> > }
> > if (fpli.WriteQuotaAvailable > 0)
>
> ...but we're unconditionally using NtQueryInformationFile at the start
> of pipe_data_available. If this is the read side of the pipe, isn't
> there a chance that another (non-Cygwin) process is performing a blocking
> read and this call will hang?
I will check that.
> Btw., this doesn't work as expected:
>
> $ yes | /cygdrive/c/Windows/System32/more
>
> It just hangs until pressing Ctrl-C. Is that expected currently?
Indeed. However, this also does not work in cygwin 3.2.0,
while
yes AAAAAA | /cygdrive/c/Windows/System32/more
works...
I am not sure why so far.
--
Takashi Yano <takashi.yano@nifty.ne.jp>
More information about the Cygwin-developers
mailing list