From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-06.nifty.com (conssluserg-06.nifty.com [210.131.2.91]) by sourceware.org (Postfix) with ESMTPS id 0ACB83858C39 for ; Thu, 16 Sep 2021 00:13:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0ACB83858C39 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=nifty.ne.jp Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp Received: from Express5800-S70 (z221123.dynamic.ppp.asahi-net.or.jp [110.4.221.123]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 18G0DPY0023572 for ; Thu, 16 Sep 2021 09:13:25 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 18G0DPY0023572 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp; s=dec2015msa; t=1631751205; bh=zZ9cqbo6bBN4yLZUbiB0KqqPhTVuIf+6JeY9tlaFLFk=; h=Date:From:To:Subject:In-Reply-To:References:From; b=wIl02BEWOCAUF6zHTSE8LTqFWhgEoLJZcnCBAGc7K6meppGkjite5tIaG6cyuRnSh P8U8oUtUPjaT91Lr2bbYYHYp4k1pnDmIVllKyrpPnqiBo5Ud+U6SOLmnq98vjLVuWq xFx2DDMMnNQgv6v0b0AZHe+nUOFQFRgZ5htxjVnLLEE0Mz1bipu7LEjKBMKYXaX2z5 DO6hHu36tbYEvMZhkXgbcW2zNX+rzTFZgrLZTK5ZJSCAX7FVvVwZ0+F6Z+/KxYwmED 9WZYBTmBfEJ0k9SdzL8cX7DApMVp/C6Sm1jfV1eaoK76NPE/ENP17m2s4LdWLQyLr9 f6FnZ/BCMUn6g== X-Nifty-SrcIP: [110.4.221.123] Date: Thu, 16 Sep 2021 09:13:24 +0900 From: Takashi Yano To: cygwin-developers@cygwin.com Subject: Re: cygrunsrv + sshd + rsync = 20 times too slow -- throttled? Message-Id: <20210916091324.4449ea2a6551f6456910fa81@nifty.ne.jp> In-Reply-To: <3ca95472-9fb2-3e62-3e28-1bd2f85bc018@cornell.edu> References: <20210915092100.796985ae33039f3184483450@nifty.ne.jp> <20210915094454.42ef1d085d9bf92a1af8d39a@nifty.ne.jp> <20210915095911.415d174ea38fb2d2ea8e5432@nifty.ne.jp> <20210915194858.845bcd54c0c63246b40703a8@nifty.ne.jp> <20210915205433.014102a9c1204687135e1417@nifty.ne.jp> <20210915220450.a96397d8b8159d9adfbdab07@nifty.ne.jp> <3ca95472-9fb2-3e62-3e28-1bd2f85bc018@cornell.edu> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 00:13:52 -0000 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. -- Takashi Yano