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

Ken Brown kbrown@cornell.edu
Mon Sep 20 21:39:54 GMT 2021


On 9/20/2021 5:27 PM, Takashi Yano wrote:
> Hi Ken,
> 
> Thanks for reviewing the code.
> 
> On Mon, 20 Sep 2021 17:09:48 -0400
> Ken Brown wrote:
>> On 9/20/2021 3:14 PM, Ken Brown wrote:
>>> +      if (wcscmp (name, ntfn->Name.Buffer) == 0)
>>> +	{
>>> +	  query_hdl_proc = proc;
>>> +	  query_hdl_value = (HANDLE)(intptr_t) shi->Handles[i].HandleValue;
>>> +	  qh = h;
>>> +	  break;
>>> +	}
>>> +close_handle:
>>> +      CloseHandle (h);
>>> +close_proc:
>>> +      CloseHandle (proc);
>>
>> Doesn't this mean that query_hdl_proc is not a valid handle any more?  So the
>> attempt to reduce overhead at the beginning of tentative_query_hdl() will never
>> work.
> 
> When the handle which name matches the pipe name is found, 'break'
> is used in the 'for' loop, so the CloseHandle(proc) is not called.
> Therefore, query_hdl_proc still has valid handle after 'break'.

Right, I realized this myself.  I guess you wrote your reply before seeing my 
later message in which I said "I see my stupid mistake".
> 
>> Other than that, I still think it looks great.  But it's complicated enough that
>> I think Corinna should review it too when she returns.  (It also uses Windows
>> functions that I have no experience with.)  Nevertheless, I'm tempted to push it
>> so that it can get testing, even if Corinna changes it or reverts it later.

I'll push it tomorrow unless you find something that needs to be changed before 
then.

Ken


More information about the Cygwin-developers mailing list