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

Re: [bug] git clone command leaves orphaned ssh process

From
Jeff King <peff@peff.net>
Date
Sep 25, 2023, 12:29 UTC
Message-ID
<20230925122921.GA2118294@coredump.intra.peff.net>
In-Reply-To
<CAN47KsUDS0om6r6WwRZHLHdETHE+Lu=bj1skG1cAwvzEUaF81Q@mail.gmail.com>
On Sun, Sep 24, 2023 at 01:25:08PM +0300, Max Amelchenko wrote:
Show 8 quoted lines
> Thanks,
> Just wanted to clarify something. This will not be handled by AWS (we
> had a support ticket re. that case), since they do not interfere with
> the running processes on its infrastructure, and if there is a
> problematic process causing this overflowing in orphaned processes, it
> needs to be handled by that process.
> The question is, doesn't Git want to ensure a clean exit in all cases?
> This is a clear example of a non-clean exit.

Git does ensure a clean exit if we run the clone process to completion. In your case we hit a fatal error midway through and are aborting. At that point we do not care what the exit code of ssh is.

We _could_ set up a signal/atexit handler combo to call waitpid(), but we would just be throwing away the result code. And that is a catch-all I would rather see done by PID 1 than by git. It can serve all processes, not just git. And it can do so more robustly, since git may be killed without a chance to run cleanup code (e.g., signal 9).

-Peff
Previous: Max Amelchenko
Message 9 of 9 in “[bug] git clone command leaves orphaned ssh process”
  1. Max AmelchenkoSep 10, 2023
  2. Bagas SanjayaSep 10, 2023
  3. Max AmelchenkoSep 10, 2023
  4. Taylor BlauSep 10, 2023
  5. Max AmelchenkoSep 11, 2023
  6. Aaron SchrabSep 12, 2023
  7. Jeff KingSep 12, 2023
  8. Max AmelchenkoSep 24, 2023
  9. Jeff KingSep 25, 2023

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.