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

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Sep 3 09:12:37 GMT 2021


On Sep  2 16:19, Ken Brown wrote:
> On 9/2/2021 3:35 PM, Corinna Vinschen wrote:
> > On Sep  2 21:00, Corinna Vinschen wrote:
> > > On Sep  2 09:01, Ken Brown wrote:
> > > > Do you think there's anything we can or should do to avoid a deadlock in the
> > > > rare cases where this fails?  The only thing I can think of immediately is
> > > > to always impose a timeout if select is called with infinite timeout on the
> > > > write side of a pipe, after which we report that the pipe is write ready.
> > > > After all, we've lived since 2008 with a bug that caused select to *always*
> > > > report write ready.
> > > 
> > > Indeed.  Hmm.  What timeout are you thinking of?  Seconds?  Minutes?
> > > 
> > > > Alternatively, we could just wait and see if there's an actual use case in
> > > > which someone encounters a deadlock.
> > > 
> > > Or that.  Fixing up select isn't too hard in that case, I guess.
> > 
> > It's getting too late again.  I drop off for tonight, but I attached
> > my POC code I have so far.  It also adds the snippets from my previous
> > patch which fixes stuff Takashi found during testing.  It also fixes
> > something which looks like a bug in raw_write:
> > 
> > -	  ptr = ((char *) ptr) + chunk;
> > +	  ptr = ((char *) ptr) + nbytes_now;
> > 
> > Incrementing ptr by chunk bytes while only nbytes_now have been written
> > looks incorrect.
> 
> Yes.  I actually copied that bug from fhandler_base_overlapped::raw_write.
> It's amazing that no one has no one has bumped into it up to now.
> > As for the reader, it makes the # of bytes to read dependent on the
> > number of reader handles.  I don't know if that's such a bright idea,
> > but this can be changed easily.
> > 
> > Anyway, this runs all my testcases successfully but they are anything
> > but thorough.
> > 
> > Patch relativ to topic/pipe attached.  Would you both mind to take a
> > scrutinizing look?
> 
> Will do.

I pushed my stuff to the topic/pipe branch split into hopefully useful
chunks.  Kick me if anything is wrong or not working.


Thanks,
Corinna


More information about the Cygwin-developers mailing list