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

Ken Brown kbrown@cornell.edu
Tue Sep 14 12:38:10 GMT 2021


On 9/14/2021 4:47 AM, Corinna Vinschen wrote:
> On Sep 14 17:07, Takashi Yano wrote:
>> On Mon, 13 Sep 2021 22:15:25 +0200
>> Corinna Vinschen wrote:
>>> That should depend on the O_CLOEXEC setting, but identically for
>>> all handles in the fhandler.
>>
>> I found the cause. set_close_on_exec() in fhandler_pipe is missing.
>> set_no_inheritance() calls for all adjunct handles are necessary.
>>
>>> I pushed two more patches to topic/pipe in terms of inheritence,
>>> maybe that gives a clue?
>>
>> I attached two additional patch for this issue.
> 
> Uh oh!  This patch to fhandler_base::dup made me check other fhandlers
> and, yeah, we have more unconditional inheritence ignoring O_CLOEXEC
> (fhandler_tape for instance).  We should fix that at one point, but that
> requires your patch to go to master first.  Let's just keep that in mind
> for now.

I think the change to fhandler_base::dup was unnecessary (technically), because 
dtable::dup_worker takes care of that with

   newfh->set_close_on_exec (!!(flags & O_CLOEXEC));

But the code is certainly more clear after the change, and I agree that it 
should be changed in the other fhandlers also.

Ken


More information about the Cygwin-developers mailing list