Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

CI captures no thread dump when a job hangs, and PR validation jobs have no timeout-minutes

オープン
#3,695 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
70/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
github-actions, java
領域
ci-cd

調査の方向性

Start in .github/workflows/build-test-prValidation.yml and other PR validation workflows. Add timeout-minutes to each job, and a step running a watchdog that captures jcmd/jstack thread dumps from sbt's forked JVMs on hang, uploading as artifact. Done when CI fails fast on hang with dumps attached.

索引モデルが issue の本文から書いたものです。

説明

build enhancement github_actions

Summary

When a CI job hangs, nothing captures a thread dump and most jobs have no timeout-minutes, so the run eventually dies on the runner's own global limit and the log contains no clue about what was blocked. Given that the test suite has several code paths that can block indefinitely, this turns an investigable hang into an unexplained red build.

Current state

There are 40 workflow files under .github/workflows/. timeout-minutes appears exactly once in all of them:

.github/workflows/nightly-multi-jvm-tests.yml:32:    timeout-minutes: 240

build-test-prValidation.yml — the workflow that runs on every PR — sets none.

No workflow captures diagnostics on a hang. Searching for the usual mechanisms returns nothing:

rg -in 'jstack|jcmd|thread.?dump|blame-hang' .github/workflows/
(no matches)

Why hangs are plausible here

The testkit contains at least three paths that can block without a deadline:

TestKit.within does not interrupt its block. testkit/src/main/scala/org/apache/pekko/testkit/TestKit.scala:415,426-436:

    val _max = max.dilated
    ...
    val ret =
      try f
      finally end = prev_end

    val diff = now - start
    assert(min <= diff, s"block took ${format(min.unit, diff)}, should at least have been $min")
    if (!lastWasNoMsg) {
      assert(diff <= max_diff, s"block took ${format(_max.unit, diff)}, exceeding ${format(_max.unit, max_diff)}")
    }

The budget is only checked after f returns. A block that never returns hangs the test forever; within provides no watchdog.

Player.enter awaits with Duration.Inf. multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Player.scala:124:

        Await.result(client ? ToServer(EnterBarrier(b, Option(barrierTimeout))), Duration.Inf)

Controller blocks on a Netty future inside a message handler. multi-node-testkit/src/main/scala/org/apache/pekko/remote/testconductor/Conductor.scala:531-532:

    case GetSockAddr =>
      sender() ! connection.channelFuture.sync().channel().localAddress()

This one is filed separately, but it is an example of the general shape: a blocked actor thread that also hosts the barrier coordinator.

Proposal

Two changes, both confined to .github/:

  1. Capture thread dumps when a test step exceeds its budget. Run the sbt invocation under a watchdog that, on expiry, executes jcmd <pid> Thread.print (or jstack -l <pid>) for every JVM in the process tree and uploads the output as an artifact before killing the step. sbt forks test JVMs, so the watchdog needs to find the children rather than only the sbt launcher.

  2. Add timeout-minutes to the PR validation jobs, set well below the runner default and above the observed p99 for each job, so a hang fails fast with the dump attached instead of consuming the full runner limit.

A dump on hang is worth more than the timeout itself: the timeout only tells you the build is red, while the dump usually names the blocked thread and the lock or Await it is stuck in — which for a distributed-systems test suite is very often the actual bug rather than a CI annoyance.

Scope

CI configuration only. No production or test-source change.

主要言語
Scala
スター
1.7k
フォーク
212
平均マージ
18時間 20分
マージ済み PR(30日)
108

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/pekko のほかの issue

apache/pekko の issue をすべて見る

似ている issue

Scala の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。