git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Alexandr Miloslavskiy via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org,
	Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>,
	Erik Faye-Lund <kusmabite@gmail.com>,
	Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>,
	Jeff Hostetler <jeffhost@microsoft.com>
Subject: Re: [PATCH v3] mingw: workaround for hangs when sending STDIN
Date: Thu, 27 Feb 2020 22:15:36 +0100 (CET)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.2002272215210.46@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <xmqqy2szkfxr.fsf@gitster-ct.c.googlers.com>

Hi Junio & Alex,

On Tue, 18 Feb 2020, Junio C Hamano wrote:

> "Alexandr Miloslavskiy via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
> > From: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
> >
> > Explanation
> > -----------
> > The problem here is flawed `poll()` implementation. When it tries to
> > see if pipe can be written without blocking, it eventually calls
> > `NtQueryInformationFile()` and tests `WriteQuotaAvailable`. However,
> > the meaning of quota was misunderstood. The value of quota is reduced
> > when either some data was written to a pipe, *or* there is a pending
> > read on the pipe. Therefore, if there is a pending read of size >= then

I usually try to refrain from grammar policing, but in this case, the typo
"then" (instead of "than") threw me.

Other than that, I think the patch is fine. At least it works as
advertised in my hands.

Thanks,
Dscho

> > the pipe's buffer size, poll() will think that pipe is not writable and
> > will hang forever, usually that means deadlocking both pipe users.
> > ...
> > Chosen solution
> > ---------------
> > Make `poll()` always reply "writable" for write end of the pipe.
> > Hopefully one day someone will find a way to implement it properly.
> >
> > Reproduction
> > ------------
> > printf "%8388608s" X >large_file.txt
> > git stash push --include-untracked -- large_file.txt
> >
> > I have decided not to include this as test to avoid slowing down the
> > test suite. I don't expect the specific problem to come back, and
> > chances are that `git stash push` will be reworked to avoid sending the
> > entire patch via STDIN.
> >
> > Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
> > ---
>
> Thanks for a detailed description.
>
> I notice that we saw no comments from Windows experts for these
> three rounds.  Can somebody give an Ack (or nack) on it at least?
>
> I picked obvious "experts" in the output from
>
>     $ git shortlog --since=1.year --no-merges master compat/ming\* compat/win\*
>
> Thanks.
>

  reply	other threads:[~2020-02-27 21:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13 18:40 [PATCH] mingw: workaround for hangs when sending STDIN Alexandr Miloslavskiy via GitGitGadget
2020-02-13 18:41 ` Test program used to prove quota's behavior Alexandr Miloslavskiy
2020-02-13 18:56 ` [PATCH] mingw: workaround for hangs when sending STDIN Eric Sunshine
2020-02-13 19:22   ` Alexandr Miloslavskiy
2020-02-17 16:25 ` [PATCH v2] " Alexandr Miloslavskiy via GitGitGadget
2020-02-17 17:24   ` Eric Sunshine
2020-02-17 17:56     ` Junio C Hamano
2020-02-17 18:01     ` Alexandr Miloslavskiy
2020-02-17 18:01   ` [PATCH v3] " Alexandr Miloslavskiy via GitGitGadget
2020-02-18 16:39     ` Junio C Hamano
2020-02-27 21:15       ` Johannes Schindelin [this message]
2020-02-27 22:59         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.QRO.7.76.6.2002272215210.46@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=alexandr.miloslavskiy@syntevo.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=jeffhost@microsoft.com \
    --cc=kusmabite@gmail.com \
    --cc=ungureanupaulsebastian@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).