Skip to content

Stop MemoryTest hanging CI on macOS - #248

Merged
andreaTP merged 1 commit into
bytecodealliance:mainfrom
andreaTP:fix-ci-hang
Oct 21, 2026
Merged

andreaTP merged 1 commit into
bytecodealliance:mainfrom
andreaTP:fix-ci-hang

Conversation

@andreaTP

Copy link
Copy Markdown
Contributor

Since #237, CI jobs on macOS with JDK 17 or 21 hang in MemoryTest until GitHub's 6 hour timeout, on PRs and on main.

waitAndNotifyWithAtomicsOnSameWord ran a task that never ends on the ForkJoin common pool, submitted its waiter to the same pool, then spun with no deadline until the waiter was parked. On JDK 17 and 21 the common pool, which has two workers on the 3-core macOS runners, can leave that waiter queued while its idle worker stays parked. A pool dump at the hang shows submissions = 1, one worker spinning and the other WAITING, so the test spins forever. Linux and Windows runners have 4 cores, which is why only macOS hangs.

The fix runs both tasks on two threads of their own. The memory code itself is unaffected.

Running MemoryTest alone pinned to 3 cores (taskset -c 0-2):

JDK 17 JDK 21
before hung in 3 of 6 runs passed 5 of 5 here, but the same loop in jshell hung after 3,719 rounds
after passed 10 of 10 passed 10 of 10

The CI job also gets timeout-minutes: 60, about twice its usual duration, so a hang fails within the hour instead of holding a runner for 6 hours.

waitAndNotifyWithAtomicsOnSameWord ran a task that never ends on the
ForkJoin common pool, submitted its waiter to the same pool, then spun
with no deadline until the waiter was parked. On JDK 17 and 21 the
common pool, which has two workers on the 3-core macOS runners, can
leave that waiter queued while its idle worker stays parked, so the
spin never ends and the job hangs until GitHub's 6 hour timeout. Run
both tasks on two threads of their own instead.

The CI job also gets a 60 minute timeout, about twice its usual
duration, so a hang can no longer hold a runner for 6 hours.
@andreaTP

Copy link
Copy Markdown
Contributor Author

Fix #247

@andreaTP
andreaTP merged commit 7ba980b into bytecodealliance:main Oct 21, 2026
25 checks passed
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