From: Eric Sunshine <sunshine@sunshineco.com>
To: Alexandr Miloslavskiy via GitGitGadget <gitgitgadget@gmail.com>
Cc: Git List <git@vger.kernel.org>,
Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>,
Erik Faye-Lund <kusmabite@gmail.com>,
Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Subject: Re: [PATCH] mingw: workaround for hangs when sending STDIN
Date: Thu, 13 Feb 2020 13:56:37 -0500 [thread overview]
Message-ID: <CAPig+cQrxKuE=a99zPF7EGUSbye_s5ATEvUkz+EqsTZAfy_CbQ@mail.gmail.com> (raw)
In-Reply-To: <pull.553.git.1581619239467.gitgitgadget@gmail.com>
On Thu, Feb 13, 2020 at 1:40 PM Alexandr Miloslavskiy via GitGitGadget
<gitgitgadget@gmail.com> wrote:
> 3) Make `poll()` always reply "writable" for write end of the pipe
> Afterall it seems that cygwin (accidentally?) does that for years.
> Also, it should be noted that `pump_io_round()` writes 8MB blocks,
> completely ignoring the fact that pipe's buffer size is only 8KB,
> which means that pipe gets clogged many times during that single
> write. This may invite a deadlock, if child's STDERR/STDOUT gets
> clogged while it's trying to deal with 8MB of STDIN. Such deadlocks
> could be defeated with writing less then pipe's buffer size per
s/then/than/
> round, and always reading everything from STDOUT/STDERR before
> starting next round. Therefore, making `poll()` always reply
> "writable" shouldn't cause any new issues or block any future
> solutions.
> 4) Increase the size of the pipe's buffer
> The difference between `BytesInQueue` and `QuotaUsed` is the size
> of pending reads. Therefore, if buffer is bigger then size of reads,
s/then/than/
> `poll()` won't hang so easily. However, I found that for example
> `strbuf_read()` will get more and more hungry as it reads large inputs,
> eventually surpassing any reasonable pipe buffer size.
> diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
> +test_expect_success 'stash handles large files' '
> + printf "%1023s\n%.0s" "x" {1..16384} >large_file.txt &&
> + git stash push --include-untracked -- large_file.txt
> +'
Use of {1..16384} is not portable across shells. You should be able to
achieve something similar by assigning a really large value to a shell
variable and then echoing that value to "large_file.txt". Something
like:
x=0123456789
x=$x$x$x$x$x$x$x$x$x$x
x=$x$x$x$x$x$x$x$x$x$x
...and so on...
echo $x >large_file.txt &&
or any other similar construct.
next prev parent reply other threads:[~2020-02-13 18:56 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 ` Eric Sunshine [this message]
2020-02-13 19:22 ` [PATCH] mingw: workaround for hangs when sending STDIN 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
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='CAPig+cQrxKuE=a99zPF7EGUSbye_s5ATEvUkz+EqsTZAfy_CbQ@mail.gmail.com' \
--to=sunshine@sunshineco.com \
--cc=alexandr.miloslavskiy@syntevo.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.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).