git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:14 UTC

Re: [PATCH 4/9] run-command: add support for timeout in command finisher

From
Junio C Hamano <gitster@pobox.com>
Date
May 22, 2026, 00:10 UTC
Message-ID
<xmqqv7cgxq0o.fsf@gitster.g>
In-Reply-To
<cf52154c-1275-4a4b-957e-5aa17f22705c@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 22 quoted lines
> Am 21.05.26 um 11:59 schrieb Siddh Raman Pant:
>> The timeout is for the failure path, where the external helper has
>> already stopped following that protocol or is blocked on something
>> outside git's control. Since git starts the helper and puts it on the
>> log/grep path, git also needs a bounded way to recover when that helper
>> does not make progress. Otherwise an optional note source can prevent
>> the main git command from completing.
>
> That Git communicates with a process that looks like it stopped is the
> normal case, for example:
>
> - Output is sent to the pager. The user can take their time to study the
> output. All the while, git waits patiently for the user to advance the
> pager.
>
> - Git fetch transfers large amounts of data across the network. Most of
> the time it waits for data to arrive and does nothing. The peer process
> looks like it hangs. Git does not decide to kill the connection at any
> time. It is the user's decision to do so.
>
> If the notes provider hangs, then it is not on Git to decide when it has
> waited long enough.

It is often the sticking sore point that there is no good timeout value that suites for everybody.

If a protocol builds its own way to declare "this backend is slow, so please do not consider less than 3 seconds of nonaction something to worry about but kill it off if you waited more than that" to make the receiving/waiting end responsible for managing timeout, that might be workable, but it certainly feels like a kludge. The protocol can instead allow an "error - for your particular request, we couldn't come up with an answer within a reasonable time limit" response (in practice, "within time limit" does not have to be the only reason for such an error) to be returned, I think.

Previous: brian m. carlsonNext: Jeff King
Message 26 of 29 in “Add support for an external command for fetching notes”
  1. 0/9 Add support for an external command for fetching notesSiddh Raman Pant, May 19, 2026
  2. 1/9 Documentation/git-range-diff: add missing notes options in synopsisSiddh Raman Pant, May 19, 2026
  3. 4/9 run-command: add support for timeout in command finisherSiddh Raman Pant, May 19, 2026
  4. 5/9 wrapper: add support for timeout and deadline in read helpersSiddh Raman Pant, May 19, 2026
  5. 6/9 t3301: cover generic displayed notes behaviorSiddh Raman Pant, May 19, 2026
  6. 7/9 notes: support an external command to display notesSiddh Raman Pant, May 19, 2026
  7. 2/9 notes: convert raw arg in format_display_notes() to boolSiddh Raman Pant, May 19, 2026
  8. 3/9 wrapper: add sleep_nanosecSiddh Raman Pant, May 19, 2026
  9. 8/9 Documentation: document external notes command optionsSiddh Raman Pant, May 19, 2026
  10. 9/9 t: add tests for external notes commandSiddh Raman Pant, May 19, 2026
  11. Junio C HamanoMay 19, 2026
  12. Junio C HamanoMay 19, 2026
  13. Junio C HamanoMay 20, 2026
  14. Siddh Raman PantMay 20, 2026
  15. Siddh Raman PantMay 20, 2026
  16. Siddh Raman PantMay 20, 2026
  17. Junio C HamanoMay 21, 2026
  18. brian m. carlsonMay 21, 2026
  19. Siddh Raman PantMay 21, 2026
  20. Siddh Raman PantMay 21, 2026
  21. Johannes SixtMay 21, 2026
  22. Oswald BuddenhagenMay 21, 2026
  23. Siddh Raman PantMay 21, 2026
  24. Johannes SixtMay 21, 2026
  25. brian m. carlsonMay 21, 2026
  26. Junio C HamanoMay 22, 2026
  27. Jeff KingMay 22, 2026
  28. Siddh Raman PantMay 22, 2026
  29. Siddh Raman PantMay 22, 2026

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.