cygrunsrv + sshd + rsync = 20 times too slow -- throttled?
Ken Brown
kbrown@cornell.edu
Thu Sep 16 02:26:42 GMT 2021
On 9/15/2021 8:13 PM, Takashi Yano wrote:
> On Wed, 15 Sep 2021 12:22:58 -0400
> Ken Brown wrote:
>> diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
>> index 566cf66d6..cdb213a42 100644
>> --- a/winsup/cygwin/select.cc
>> +++ b/winsup/cygwin/select.cc
>> @@ -645,7 +645,7 @@ pipe_data_available (int fd, fhandler_base *fh, HANDLE h,
>> bool writing)
>> 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;
>> + return -1;
>> fpli.WriteQuotaAvailable = fpli.InboundQuota - nbytes_in_pipe;
>> }
>> if (fpli.WriteQuotaAvailable > 0)
>
> I think this is not correct. IIUC, return value -1 means that the
> other side of pipe is closed. However, in this case, NtQueryInformationFile
> is succeeded previously. So the other side of pipe is still alive. I cannot
> imagine when PeekNamedPipe fails, however, if query_hdl is lost accidentally,
> returning 1 is the correct thing just as the case query_hdl == NULL.
Ah, you're right of course. A failure of a call on query_hdl doesn't indicate
an exceptional condition on the write side of the pipe.
Thanks.
Ken
More information about the Cygwin-developers
mailing list