git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v7 09/10] sub-process: move sub-process functions into separate files

From
Jeff King <peff@peff.net>
Date
May 13, 2017, 09:07 UTC
Message-ID
<20170513090740.xldv4td3omhg3gxc@sigill.intra.peff.net>
In-Reply-To
<20170505152802.6724-10-benpeart@microsoft.com>
On Fri, May 05, 2017 at 11:28:01AM -0400, Ben Peart wrote:
Show 10 quoted lines
> +static void subprocess_exit_handler(struct child_process *process)
> +{
> +	sigchain_push(SIGPIPE, SIG_IGN);
> +	/* Closing the pipe signals the subprocess to initiate a shutdown. */
> +	close(process->in);
> +	close(process->out);
> +	sigchain_pop(SIGPIPE);
> +	/* Finish command will wait until the shutdown is complete. */
> +	finish_command(process);
> +}

This isn't a new issue with your series, but the SIGPIPEs here seem odd. I don't think you can get SIGPIPE from closing descriptors.

I suspect this is a hold-over from when Lars' original design, where we actually sent an "exit" message to the filter. It's not hurting anything, and I don't think it's worth holding up your series for. But when you are working in this area further, it might be worth cleaning up.

-Peff
Previous: Ben PeartNext: Ben Peart
Message 11 of 16 in “refactor the filter process code into a reusable module”
  1. 00/10 refactor the filter process code into a reusable moduleBen Peart, May 5, 2017
  2. 01/10 convert: remove erroneous tests for errno == EPIPEBen Peart, May 5, 2017
  3. 02/10 pkt-line: fix packet_read_line() to handle len < 0 errorsBen Peart, May 5, 2017
  4. 03/10 pkt-line: add packet_read_line_gently()Ben Peart, May 5, 2017
  5. 04/10 convert: move packet_write_line() into pkt-line as packet_writel()Ben Peart, May 5, 2017
  6. Jeff KingMay 13, 2017
  7. Junio C HamanoMay 15, 2017
  8. 05/10 convert: split start_multi_file_filter() into two separate functionsBen Peart, May 5, 2017
  9. 07/10 convert: Update generic functions to only use generic data structuresBen Peart, May 5, 2017
  10. 09/10 sub-process: move sub-process functions into separate filesBen Peart, May 5, 2017
  11. Jeff KingMay 13, 2017
  12. 10/10 convert: Update subprocess_read_status to not die on EOFBen Peart, May 5, 2017
  13. 08/10 convert: rename reusable sub-process functionsBen Peart, May 5, 2017
  14. 06/10 convert: Separate generic structures and variables from the filter specific onesBen Peart, May 5, 2017
  15. Junio C HamanoMay 8, 2017
  16. Jeff KingMay 13, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.