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

Re: [PATCH] run-command: detect finished children by closed pipe rather than waitpid

From
Stefan Beller <sbeller@google.com>
Date
Nov 11, 2015, 20:37 UTC
Message-ID
<CAGZ79kaZ0W5q8=iowbSTJY_mDNNYc6qdTszcWDDDCtYfZyeK_Q@mail.gmail.com>
In-Reply-To
<563DBDDA.2000106@kdbg.org>
including the list and all others this time.
Show 8 quoted lines
>>                         if (code < 0) {
>>                                 pp->shutdown = 1;
>> -                               kill_children(pp, SIGTERM);
>> +                               kill_children(pp, -code);
>
>
> I'll see what this means for our kill emulation on Windows. Currently, we
> handle only SIGTERM.

So currently we only pass in SIGTERM from the callers, and I certainly only intend to use that signal. I just thought special casing the SIGTERM signal would do no good in terms of design here.

So maybe that was not the right thought and we do have to special case SIGTERM here?

I worked with another large proprietary parallel program (spawning child processes) before. If you pressed CTRL-C, it would omit a message like:

    Sending no further input to the children
If you press Ctrl-C again, it would print:
    Sending SIGTERM to children, to shut them down gracefully
If you pressed once again, you'll get a
    User seems to be angry, shutting down hard, sending SIGKILL
    $ # that was fast now.

I guess we don't want to play around like that, but if the parent process gets a SIGTERM, we relay that and other signals we ignore for now?

Previous: Johannes SixtNext: Johannes Sixt
Message 4 of 7 in “run-command: detect finished children by closed pipe rather than waitpid”
  1. run-command: detect finished children by closed pipe rather than waitpidStefan Beller, Nov 6, 2015
  2. Torsten BögershausenNov 7, 2015
  3. Johannes SixtNov 7, 2015
  4. Stefan BellerNov 11, 2015
  5. Johannes SixtNov 11, 2015
  6. Stefan BellerNov 11, 2015
  7. Johannes SixtNov 11, 2015

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.