git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Lars Schneider <larsxschneider@gmail.com>, git@vger.kernel.org
Cc: gitster@pobox.com, peff@peff.net, e@80x24.org, ttaylorr@github.com
Subject: Re: [PATCH v4 4/4] convert: add "status=delayed" to filter process protocol
Date: Mon, 22 May 2017 21:58:14 +0200	[thread overview]
Message-ID: <64b1fda4-9f79-1bd8-ad6d-43196b808d61@web.de> (raw)
In-Reply-To: <20170522135001.54506-5-larsxschneider@gmail.com>

On 2017-05-22 15:50, Lars Schneider wrote:
> +
> +int async_query_available_blobs(const char *cmd, struct string_list *delayed_paths)
> +{
> +	int err;
> +	char *line;
> +	struct cmd2process *entry;
> +	struct child_process *process;
> +	struct strbuf filter_status = STRBUF_INIT;
> +
> +	entry = find_multi_file_filter_entry(&cmd_process_map, cmd);
> +	if (!entry) {
> +		error("external filter '%s' is not available anymore although "
> +		      "not all paths have been filtered", cmd);
> +		return 0;
> +	}
> +	process = &entry->process;
> +	sigchain_push(SIGPIPE, SIG_IGN);
> +
> +	err = packet_write_fmt_gently(
> +		process->in, "command=list_available_blobs\n");
> +	if (err)
> +		goto done;
> +
> +	err = packet_flush_gently(process->in);
> +	if (err)
> +		goto done;
> +
> +	for (;;) {
> +		const char* pre = "pathname=";
> +		const int pre_len = strlen(pre);
> +		line = packet_read_line(process->out, NULL);
> +		if (!line)
> +			break;
> +		err = strlen(line) <= pre_len || strncmp(line, pre, pre_len);
> +		if (err)
> +			goto done;
> +		string_list_insert(delayed_paths, xstrdup(line+pre_len));
> +	}
> +
> +	read_multi_file_filter_status(process->out, &filter_status);
> +	err = strcmp(filter_status.buf, "success");
> +
> +done:
> +	sigchain_pop(SIGPIPE);
> +
> +	if (err || errno == EPIPE) {

This looks strange, at first glance.
Do we set errno to 0 before ?
Or is there a trick that EPIPE can only be reached,
if it is "our" error ?


> +		if (!strcmp(filter_status.buf, "error")) {
> +			/* The filter signaled a problem with the file. */
> +		} else {
> +			/*
> +			 * Something went wrong with the protocol filter.
> +			 * Force shutdown and restart if another blob requires
> +			 * filtering.
> +			 */
> +			error("external filter '%s' failed", cmd);
> +			kill_multi_file_filter(&cmd_process_map, entry);
> +		}
> +	}
> +	return !err;
> +}
> +


  parent reply	other threads:[~2017-05-22 19:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22 13:49 [PATCH v4 0/4] convert: add "status=delayed" to filter process protocol Lars Schneider
2017-05-22 13:49 ` [PATCH v4 1/4] t0021: keep filter log files on comparison Lars Schneider
2017-05-22 13:49 ` [PATCH v4 2/4] t0021: make debug log file name configurable Lars Schneider
2017-05-22 13:50 ` [PATCH v4 3/4] t0021: write "OUT" only on success Lars Schneider
2017-05-22 13:50 ` [PATCH v4 4/4] convert: add "status=delayed" to filter process protocol Lars Schneider
2017-05-22 19:30   ` Taylor Blau
2017-05-22 19:52   ` Torsten Bögershausen
2017-05-22 20:33     ` Lars Schneider
2017-05-22 19:58   ` Torsten Bögershausen [this message]
2017-05-22 20:37     ` Lars Schneider
2017-05-23  5:22       ` Junio C Hamano
2017-05-23  8:43         ` Lars Schneider
2017-05-29 11:11           ` Lars Schneider
2017-05-30  1:03             ` Junio C Hamano
2017-05-30  1:55               ` 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=64b1fda4-9f79-1bd8-ad6d-43196b808d61@web.de \
    --to=tboegi@web.de \
    --cc=e@80x24.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=larsxschneider@gmail.com \
    --cc=peff@peff.net \
    --cc=ttaylorr@github.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).