Repository navigation
Monitor the memory of the macOS build and test jobs - #49
Open
Roberto-Gentili wants to merge 1 commit into
Open
Roberto-Gentili wants to merge 1 commit into
Roberto-Gentili wants to merge 1 commit into
Conversation
Three build and test jobs on macos-26-intel stopped responding in the "Build and test" step until the timeout or the cancellation, and GitHub kept no log of them: the runner itself stopped answering. On macOS the tests now run under .github/scripts/macos-memory-monitor.sh, which samples the memory of the runner and of the test JVM every 2 seconds, logs a summary every 30 seconds and the native memory of the test JVM every minute, and kills the test JVM, after saving its thread dump, if the memory pressure of the runner stays critical for 10 seconds or the free disk space falls below 1 GB, so that the job fails with its log instead of losing the runner. The test JVM runs with Native Memory Tracking, and the files of the monitor are uploaded as an artifact.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three build and test jobs on
macos-26-intelstopped responding in the Build and test step until the timeout of 30 minutes or the cancellation, and GitHub kept no log of them (BlobNotFound):Each of them was closed about 5 minutes after the timeout or the cancellation, which is how long GitHub waits for a runner that does not answer, and none of them has the warnings about the actions running on Node.js 20 that every completed job has: the runner itself stopped answering, and nothing that the job writes survives it. Since the macOS jobs moved to
macos-26-intelon 27 November (e6e5299), 3 of the 179 jobs that got a runner were lost, in 3 of 8 runs; on the arm64 runners used before, which have half the memory, none of about 350 jobs was lost. This matchesactions/runner-images#13882, random hangs of the macOS 26 x86_64 runners, so the platform is a more likely cause than the memory used by the tests, but there is no data on the memory of the macOS jobs to rule that out..github/scripts/macos-memory-monitor.sh. Every 2 seconds it samples the memory pressure, the free, active, wired and compressed memory, the swap, the load and the free disk space of the runner, and the RSS and the threads of the test JVM and of Maven. It logs a summary every 30 seconds and whenever the memory pressure changes, the native memory of the test JVM every minute, and the highest values in the summary of the job.-XX:NativeMemoryTracking=summary). The files of the monitor, with anyhs_err_pid*.logand*.dumpstream, are uploaded as the artifactmemory-monitor-jdk-<version>-attempt-<attempt>even when the job fails, and kept for 14 days.How this is tested. actionlint 1.7.12 passes on both workflows, and reports the errors of a copy with a misspelled condition and input. The script was run on Windows with Git Bash and stubs of
vm_stat,sysctl,sw_vers,df,ps,pgrep,top,jcmdandjavathat print what the macOS commands print: with critical memory pressure and with low disk space it logged the state, saved the thread dump and killed the stub of the test JVM, with normal values it let the command end, and in all cases it kept the exit status of the command and wrote the summary. It has not run on macOS yet: the jobs of this pull request are its first real run.Limits. If the runner hangs without the memory growing first, the monitor cannot record it, because the log of the step and the artifact are lost with the runner; even then, the samples of the jobs that finish show how far the memory stays from the limits. Native Memory Tracking adds a little memory and time to the test JVM. The thresholds are a guess: if they kill a JVM that would have recovered, the job fails where it would have passed.
Next. When the jobs of this pull request have finished, a second commit will move the macOS jobs of the five build and test workflows to
macos-15-intel, the workaround that CPython used for the same issue, to compare the duration and the memory of the jobs with the ones onmacos-26-intel.🤖 Generated with Claude Code