Skip to content

Mm/ci diagnose hangs#2173

Closed
mmontalbo wants to merge 3 commits into
gitgitgadget:masterfrom
mmontalbo:mm/ci-diagnose-hangs
Closed

Mm/ci diagnose hangs#2173
mmontalbo wants to merge 3 commits into
gitgitgadget:masterfrom
mmontalbo:mm/ci-diagnose-hangs

Conversation

@mmontalbo

Copy link
Copy Markdown

Thanks for taking the time to contribute to Git! Please be advised that the
Git community does not use github.com for their contributions. Instead, we use
a mailing list (git@vger.kernel.org) for code submissions, code reviews, and
bug reports. Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/)
to conveniently send your Pull Requests commits to our mailing list.

For a single-commit pull request, please leave the pull request description
empty
: your commit message itself should describe your changes.

Please read the "guidelines for contributing" linked above!

mmontalbo added 3 commits July 7, 2026 22:57
When a test hangs, prove produces no further output, so the CI job simply
idles until the platform's hard timeout (six hours on GitHub) and is then
cancelled, with nothing in the log to say which test stalled. Diagnosing
such a hang currently means correlating a healthy run's test list against
the truncated one to find the test that never reported, which is slow and
only possible after the fact.

Start a watchdog at the beginning of the build-and-test run that, if it
sees no progress for GIT_TEST_STALL_TIMEOUT seconds (two hours by default,
well beyond a healthy run), dumps state that points at the culprit:

  - the tests still in flight: test-lib removes a test's trash directory
    only once it passes, so a surviving one has not finished;
  - the tail of each such test's --verbose-log trace, i.e. the command it
    is stuck on (our CI already runs with --verbose-log -x);
  - the process table sorted by resident memory, plus the machine's
    memory and kernel log, to spot a memory or OOM cascade.

The watchdog only reports; it neither fails nor kills anything, so it
cannot cause a spurious failure even if it fires on an unusually slow run.
It counts down in short sleeps rather than one long "sleep" so that when
it is stopped on the happy path, no long-lived sleep lingers holding the
job's output open. The logic lives in the shared ci/ scripts, so both the
GitHub and GitLab pipelines benefit.

Signed-off-by: Michael Montalbo <mmontalbo@gmail.com>
The previous commit makes a stalled test run dump diagnostics, but the job
itself still idles until GitHub's six-hour hard limit before it is
cancelled. Give the test jobs an explicit timeout-minutes so that a hang
fails the job within a few hours instead, shortly after the ci/ stall
watchdog has printed its diagnostics, and GitHub tears down the job's
process tree cleanly. Three hours leaves ample margin over a healthy run
(well under two hours) while still saving half of the wasted budget.

Signed-off-by: Michael Montalbo <mmontalbo@gmail.com>
@gitgitgadget

gitgitgadget Bot commented Jul 8, 2026

Copy link
Copy Markdown

There is a merge commit in this Pull Request:

e0677dc86c2bc50c7a950653d765802b0510cb84

Please rebase the branch and force-push.

@mmontalbo mmontalbo closed this Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant