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

Re: [PATCH] run-command: don't spam trace2_child_exit()

From
Josh Steadmon <steadmon@google.com>
Date
May 5, 2022, 19:44 UTC
Message-ID
<YnQpFwcB3V07qNi3@google.com>
In-Reply-To
<xmqqr15gev94.fsf@gitster.g>
On 2022.04.28 14:46, Junio C Hamano wrote:
Show 9 quoted lines
> Josh Steadmon <steadmon@google.com> writes:
> 
> > In rare cases, wait_or_whine() cannot determine a child process's exit
> > status (and will return -1 in this case). This can cause Git to issue
> > trace2 child_exit events despite the fact that the child is still
> > running.
> 
> Rather, we do not even know if the child is still running when it
> happens, right?
Correct, if you'd like me to clarify the commit message I'll send a V2.
> It is curious what "rare cases" makes the symptom
> appear.  Do we know?

Unfortunately, no. The quoted 80 million exit event instance was not reproducible.

Show 9 quoted lines
> The patch looks OK from the "we do not know the child exited in this
> case, so we shouldn't be reporting the child exit" point of view, of
> course.  Having one event that started a child in the log and then
> having millions of events that reports the exit of the (same) child
> is way too broken.  With this change, we remove these phoney exit
> events from the log.
> 
> Do we know, for such a child process that caused these millions
> phoney exit events, we got a real exit event at the end?

We don't know. The trace log filled up the user's disk in this case, so the log was truncated.

Show 5 quoted lines
> Otherwise,
> we'd still have a similar problem in the opposite direction, i.e. a
> child has a start event recorded, many exit event discarded but the
> log lacks the true exit event for the child, implying that the child
> is still running because we failed to log its exit?
Yes, that is a weakness with this approach.
Show 10 quoted lines
> >  int finish_command_in_signal(struct child_process *cmd)
> >  {
> >  	int ret = wait_or_whine(cmd->pid, cmd->args.v[0], 1);
> > -	trace2_child_exit(cmd, ret);
> > +	if (ret != -1)
> > +		trace2_child_exit(cmd, ret);
> >  	return ret;
> >  }
> 
> Will queue; thanks.

Thanks, and sorry for the delayed reply, I've been out sick for a few days.

Previous: Josh SteadmonNext: Josh Steadmon
Message 7 of 10 in “run-command: don't spam trace2_child_exit()”
  1. run-command: don't spam trace2_child_exit()Josh Steadmon, Apr 28, 2022
  2. Junio C HamanoApr 28, 2022
  3. Jeff HostetlerMay 3, 2022
  4. Josh SteadmonMay 5, 2022
  5. Jeff HostetlerMay 10, 2022
  6. Josh SteadmonJun 7, 2022
  7. Josh SteadmonMay 5, 2022
  8. run-command: don't spam trace2_child_exit()Josh Steadmon, Jun 7, 2022
  9. Ævar Arnfjörð BjarmasonJun 7, 2022
  10. Jeff HostetlerJun 10, 2022

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.