Repository navigation
ci(gate): sample memory and disk while a lane runs (#2593) - #2980
Merged
Merged
Conversation
Member
Author
|
CI is green and the PR is queued.
Handed off to the coordinator. |
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.
Refs #2593 (part A4 of the
Decided:at 11:32Z; A3 stays open).What and why
The merge queue's worst stall in #2593 was a runner that died mid-job: exit 143, every later step "completed", the job still
in_progressuntil the timeout. The log streamed up to that point is all anyone gets, and it did not say whether the runner had run out of memory or disk. This prints one memory and disk sample into that live log every 30 s while a lane's child runs, which is what the next lost runner needs to be diagnosable.The gate already streams every lane's child through
run()inci/local_gate.py, so the sampler lives there rather than in a workflow step: one call site covers the lint, rust-test, cross and cross-release lanes on every caller (local./lint/./unittest,Local Gate (lint)inbuild-project.yaml, and the Windows/macOS Rust test steps that call the same lanes).OBS_GATE_RESOURCE_SAMPLES=0turns it off.resource_sample()returns one line:resources: mem <used> MB used of <total> MB (<available> MB available) disk <used> GB used of <total> GB (<free> GB free). Memory comes from/proc/meminfo, disk fromshutil.disk_usage(ROOT); a host without/proc/meminfo(macOS) reportsmem unavailableand still reports disk.sample_while(emit)is a daemon thread that prints a sample every 30 s until the child exits, so a killed runner's last streamed lines include the last sample.run()is given abuffer(the step that runs beside Clippy): that buffer is only printed after the child finished, which is too late to be evidence.RED → GREEN
b1c8ce44b:ci/test_resource_samples.pyagainst the unchanged gate. All four cases error onmock.patch.object(local_gate, "RESOURCE_SAMPLE_SECONDS", ...):AttributeError: ... does not have the attribute 'RESOURCE_SAMPLE_SECONDS'.556fa6667: the sampler.uv run python -m unittest discover -s ci -p test_resource_samples.py→ 4 tests, OK;./lint→lane lint: ok (71.0s).The four cases: the sample names memory and disk on one line; it degrades to
diskalone when/proc/meminfois absent;run()prints a sample while a child runs;OBS_GATE_RESOURCE_SAMPLES=0suppresses them.Scope
Decided:calls it a workflow-behaviour choice with a cost, andmay implement A4 and leave A3.docs/features.mdline: CI-only, nothing a user of OBS can notice.