Repository navigation
test(embed): measure execution memory headroom against a per-process limit - #33142
Merged
Merged
Conversation
…limit
Coverage UT runs eight test packages at once on a 15 GiB runner. A CN in
an embedded test cluster admitted execution memory against the host's
available memory minus a 1 GiB margin, so when other packages held the
host near that margin even a 48-byte request was rejected
("execution resource admission rejected ... growth_headroom=0") and
unrelated tests such as TestSnapshotDatabasePublicationReplayBoundaries
failed at random.
A process can now give execution admission a private memory limit
(process.SetExecutionPrivateMemoryLimit). With one set, physical headroom
is the limit minus this process's own resident memory, and the safety
margin is sized from the limit rather than the host. Embedded test
clusters set 8 GiB; the heaviest packages peak at 2-4 GiB under -cover.
Servers never set a limit and keep the host/cgroup measurement.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Contributor
|
This pull request is merged. |
This branch was successfully 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.
What type of PR is this?
Which issue(s) this PR fixes:
issue #33077
Also seen on #33115 (run 45332505615):
TestSnapshotDatabasePublicationReplayBoundaries/incomplete_view_scopefailed onuse mo_catalogwithWhat this PR does / why we need it:
Coverage UT runs 8 packages at once (
-p 8) on a 15 GiB runner. A CN in an embedded test cluster admits execution memory against the host's available memory minus a 1 GiB margin. When other test binaries hold the host near that margin, every new allocation is refused, even 48 bytes, and whichever embedded test runs a query at that moment fails. The failure has nothing to do with the test or the PR under test.This PR lets a process give execution admission a private memory limit:
process.SetExecutionPrivateMemoryLimit(limit): when non-zero, physical headroom islimit − this process's resident memory(system.ProcessResidentMemory). The process is treated as if it ran alone in a container of that size. The safety margin is sized from the limit instead of the whole host, so a large dev machine does not reserve more than the limit allows.embed.WithTesting) set 8 GiB before starting. Admission still refuses when the test process itself grows too large, but other processes on the runner no longer decide the outcome.Limit sizing: peak RSS measured locally with
-cover -shortbinaries, as in CI:With 8 GiB and the 1 GiB margin, refusal starts at about 7 GiB. All three packages pass with no refusals.
Tests: headroom arithmetic; headroom read from this process's own memory; the safety margin under a private limit; and a 48-byte request refused or admitted depending on this process's own memory use under the limit.
pkg/vm/processandpkg/common/systempass; golangci-lint reports 0 issues.Not changed: lock-retry pacing (
lockop) and vector-index build sizing also read host free memory, but neither refuses small queries.🤖 Generated with Claude Code