Conversation
…g it "Attribute search latency per query shape" ran `jq -rs` over the k6 points file, which holds every metric of every search request. `-s` loads the whole stream into one in-memory array, so memory grows with the file, not with the handful of query shapes being summarised. The self-hosted runner has been lost in this step three times: runs 30550776427, 33515369645 and 36423973848. In the last one, sqlite with tests=prewarm,search searched a near-empty database very fast, and the points artifact alone was 317 MB compressed. .github/scripts/fhir-bench/search_by_shape.py reads the file line by line and keeps only per-shape duration arrays. It produces the same table: jq's `//` (null and false count as missing), jq's round-half- away-from-zero, the same median/p95/max indices, and ties in ascending shape order. On a 3,000,000-line fixture its output was byte-identical to jq's: ~5 s and ~16 MB peak, against ~68 s and ~4.7 GB for jq -rs. Unlike jq it also skips a malformed line instead of producing nothing. The step also gets timeout-minutes: 15, and matrix.backend moves to its env: so the run block holds no expressions. Refs #1475 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013NudzWDu2yTGExYaxdTQYJ
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.
Follow-up to #1544, which is now merged into
ci/bench-host-hardening(#1543). This PR's base is that branch.Problem
"Attribute search latency per query shape" ran
jq -rsoverbench-results/<backend>/search-points.json. That file is k6's--out jsonstream, one line for every metric of every search request.-sloads the whole stream into a single in-memory array, so memory grows with the file size, not with the ~20 query shapes being summarised.This step has died from memory exhaustion three times:
109920 Killed jq -rsafter 3m47s. The dispatch wasbackend=all,tests=prewarm,search, so the leg searched a near-empty database: 2.2M requests in 136 s, which made a 9.17 GB (8.5 GiB), 26.3M-linesearch-points.json. The runner itself survived. The||fallback printed the warning, and the job then ended. ci(bench): harden shared-host cleanup in fhir-benchmark.yml #1543's teardown ordering had already stopped the containers.In the two earlier runs, the job was cancelled in this step and every later step was skipped.
Every new leg added by #1475 runs this step, which makes it more likely to hit.
Fix
.github/scripts/fhir-bench/search_by_shape.pyreads the file line by line and keeps only per-shape duration arrays (array('d')). It produces the same table as the jq program://:nullandfalsecount as missing, while an empty string does not;round, half away from zero;sort_by(-.p95)with ties in ascending shape order, asgroup_bygives.timeout-minutes: 15, andmatrix.backendmoves toenv:so the run block holds no expressions.Verification
Equivalence with the old jq program, extracted verbatim from the workflow and run with jq 1.8.2:
.5values): byte-identical.search_by_shape.pyjq -rsactionlint 1.7.12: clean.
Live run: the same dispatch that lost the runner (
-f backend=all -f tests=prewarm,search) is re-running from this branch as 36427203450. Results will be added here.Refs #1475
🤖 Generated with Claude Code
https://claude.ai/code/session_013NudzWDu2yTGExYaxdTQYJ