From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Jeff King <peff@peff.net>
Cc: "SZEDER Gábor" <szeder.dev@gmail.com>,
"Git mailing list" <git@vger.kernel.org>,
"Clemens Buchacher" <drizzd@gmx.net>
Subject: Re: t5570-git-daemon fails with SIGPIPE on OSX
Date: Sat, 2 Mar 2019 22:21:00 +0100 (STD) [thread overview]
Message-ID: <nycvar.QRO.7.76.6.1903022209110.45@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <20190301190042.GF30847@sigill.intra.peff.net>
Hi Peff,
On Fri, 1 Mar 2019, Jeff King wrote:
> diff --git a/builtin/fetch.c b/builtin/fetch.c
> index b620fd54b4..4ba63d5ac6 100644
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@ -1556,7 +1556,9 @@ static int fetch_one(struct remote *remote, int argc, const char **argv, int pru
>
> sigchain_push_common(unlock_pack_on_signal);
> atexit(unlock_pack);
> + sigchain_push(SIGPIPE, SIG_IGN);
> exit_code = do_fetch(gtransport, &rs);
> + sigchain_pop(SIGPIPE);
> refspec_clear(&rs);
> transport_disconnect(gtransport);
> gtransport = NULL;
That indeed does the job:
https://git.visualstudio.com/git/_build/results?buildId=358
> That said, I actually think it's kind of pointless for git-fetch to use
> SIGPIPE at all. The purpose of SIGPIPE is that you can write a naive
> program that spews output, and you'll get informed (forcefully) by the
> OS if the process consuming your output stops listening. That makes
> sense for programs like "git log", whose primary purpose is generating
> output.
>
> But for git-fetch, our primary purpose is receiving data and writing it
> to disk. We should be checking all of our write()s already, and SIGPIPE
> is just confusing. The only "big" output we generate is the status table
> at the end. And even if that is going to a pipe that closes, I don't
> think we'd want to fail the whole command (we'd want to finalize any
> writes for what we just fetched, clean up after ourselves, etc).
>
> So I'd actually be fine with just declaring that certain commands (like
> fetch) just ignore SIGPIPE entirely.
That's a bigger change than I'm comfortable with, so I'd like to go with
tge diff you gave above.
Do you want to turn these two patches into a proper patch series?
Otherwise I can take care of it, probably this Monday or Tuesday.
Ciao,
Dscho
next prev parent reply other threads:[~2019-03-02 21:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-06 15:11 t5570-git-daemon fails with SIGPIPE on OSX SZEDER Gábor
2018-08-06 15:31 ` SZEDER Gábor
2019-02-08 8:32 ` Johannes Schindelin
2019-02-08 12:54 ` SZEDER Gábor
2018-08-14 22:32 ` Jeff King
2018-08-14 22:37 ` Jeff King
2019-02-08 9:02 ` Johannes Schindelin
2019-02-08 9:28 ` Johannes Schindelin
2019-02-08 19:54 ` Jeff King
2019-03-01 15:02 ` Johannes Schindelin
2019-03-01 19:00 ` Jeff King
2019-03-02 21:21 ` Johannes Schindelin [this message]
2019-03-03 16:54 ` Jeff King
2019-03-03 16:55 ` [PATCH 1/2] fetch: avoid calling write_or_die() Jeff King
2019-03-04 13:42 ` Duy Nguyen
2019-03-05 4:11 ` Jeff King
2019-03-03 16:58 ` [PATCH 2/2] fetch: ignore SIGPIPE during network operation Jeff King
2019-03-04 1:11 ` Junio C Hamano
2019-03-05 4:11 ` Jeff King
2019-03-03 1:21 ` t5570-git-daemon fails with SIGPIPE on OSX Junio C Hamano
2019-03-03 14:56 ` Johannes Schindelin
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.1903022209110.45@tvgsbejvaqbjf.bet \
--to=johannes.schindelin@gmx.de \
--cc=drizzd@gmx.net \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=szeder.dev@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).