From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Jehan Bing <jehan@orb.com>,
git@vger.kernel.org, gitster@pobox.com, j.sixt@viscovery.net,
peff@peff.net
Subject: Re: [PATCH] Ignore SIGPIPE when running a filter driver
Date: Tue, 21 Feb 2012 12:58:53 -0800 [thread overview]
Message-ID: <7vlinvgaya.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20120221030150.GA31737@burratino> (Jonathan Nieder's message of "Mon, 20 Feb 2012 21:01:50 -0600")
Jonathan Nieder <jrnieder@gmail.com> writes:
>> If a filter is not defined or if it fails, git behaves as if the filter
>> is a no-op passthru. However, if the filter exits before reading all
>> the content, and depending on the timing git, could be kill with
>> SIGPIPE instead.
>>
>> Ignore SIGPIPE while processing the filter to detect when it exits
>> early and fallback to using the unfiltered content.
>>
>> Signed-off-by: Jehan Bing <jehan@orb.com>
>
> For the benefit of the uninitiated ("how would ignoring an error help
> me detect an error?"): setting the SIGPIPE handler to SIG_IGN does not
> actually ignore the broken pipe condition but causes it to be reported
> as an I/O error, errno == EPIPE. That means instead of being killed
> by SIGPIPE, git gets to fall back to passthrough and report the
> filter's mistake.
Yes.
You could rephrase bit better to further clarify it, perhaps like this:
Ignore SIGPIPE when running a filter driver
If a filter is not defined or if it fails, git should behave as if the
filter is a no-op passthru.
However, if the filter exits before reading all the content, depending on
the timing, git could be killed with SIGPIPE when it tries to write to the
pipe connected to the filter.
Ignore SIGPIPE while processing the filter to give us a chance to check
the return value from a failed write, in order to detect and act on this
mode of failure in a more controlled way.
Signed-off-by: Jehan Bing <jehan@orb.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
although I think Jehan's original was already clear enough.
> So at least on POSIX-y platforms, this patch looks good to me. Thanks
> for writing it.
Thank you and Johannes for eyeballing and sanity checking.
Will queue.
prev parent reply other threads:[~2012-02-21 20:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-20 20:53 [PATCH] Ignore SIGPIPE when running a filter driver Jehan Bing
2012-02-20 22:11 ` Junio C Hamano
2012-02-21 19:20 ` Johannes Sixt
2012-02-21 3:01 ` Jonathan Nieder
2012-02-21 20:58 ` Junio C Hamano [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vlinvgaya.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=j.sixt@viscovery.net \
--cc=jehan@orb.com \
--cc=jrnieder@gmail.com \
--cc=peff@peff.net \
/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.
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 NNTP newsgroup(s).