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

Re: [ANNOUNCE] Git v2.33.0-rc2 (Build/Test Report)

From
Jeff King <peff@peff.net>
Date
Aug 16, 2021, 21:55 UTC
Message-ID
<YRretXfEfiVujSeO@coredump.intra.peff.net>
In-Reply-To
<01b901d792d0$1e993950$5bcbabf0$@nexbridge.com>
On Mon, Aug 16, 2021 at 02:54:14PM -0400, Randall S. Becker wrote:
Show 10 quoted lines
> >That 60 seconds is the timeout from t5562/invoke-with-content-length.
> >
> >So one, are you sure it's hanging forever, and not just for 60 seconds?
> 
> Absolutely sure. 48 hours because I forgot to check.
> 
> >And two, it is quite obvious there's some racing here. I'm not sure if this is indicative of a problem in the test suite, or in http-backend
> >itself (in which case it could be affecting real users).
> 
> How can I help track this down?

Here's what I found out so far. For my 60-second lag case, the test _does_ complete as expected; it just takes a long time. So I think what happens is this:

  - the invoke-with-content-length script sets up a SIGCLD handler
  - then it kicks off http-backend and writes to it
  - then it sleeps for 60 seconds, assuming that SIGCLD will interrupt
    the sleep
  - after the sleep finishes (whether by 60 seconds or because it was
    interrupted by the signal), we check a flag to see if our SIGCLD
    handler was called. If not, then we complain.

This usually completes instantaneously-ish, because the signal interrupts our sleep. But very occasionally the child process dies _before_ we hit the sleep, so we don't realize it.

So ideally we'd have some way of atomically checking our flag and then sleeping only if it's not set. But I don't think that exists. The closest we can come is using a series of smaller sleeps and checks. And indeed, digging in the archive shows that Max already proposed such a patch:

  https://lore.kernel.org/git/20190218205028.32486-1-max@max630.net/

It looks like it feel through the cracks, though. Maybe now is a good time to resurrect it.

However, you are in that thread, too, and it didn't help your situation. So I think your race is somehow different. It looks like there was some weirdness around close() for you, though generally we _shouldn't_ be hitting that close() at all, because we'd have gotten SIGCLD and set the $exited flag in the interim.

-Peff
Previous: Randall S. BeckerNext: Jeff King
Message 7 of 17 in “RE: [ANNOUNCE] Git v2.33.0-rc2 (Build/Test Report)”
  1. Randall S. BeckerAug 13, 2021
  2. Junio C HamanoAug 13, 2021
  3. Jeff KingAug 13, 2021
  4. Randall S. BeckerAug 16, 2021
  5. Jeff KingAug 16, 2021
  6. Randall S. BeckerAug 16, 2021
  7. Jeff KingAug 16, 2021
  8. Jeff KingAug 16, 2021
  9. Randall S. BeckerAug 16, 2021
  10. Jeff KingAug 16, 2021
  11. Randall S. BeckerAug 16, 2021
  12. Jeff KingAug 16, 2021
  13. Randall S. BeckerAug 16, 2021
  14. Jeff KingAug 16, 2021
  15. Jeff KingAug 16, 2021
  16. Randall S. BeckerAug 17, 2021
  17. Randall S. BeckerAug 17, 2021

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.