(via Bnjoroge1): Halve memory-derived warm pool size to prevent OOM during successor prov - #169
Merged
Bnjoroge1 merged 1 commit intoAug 21, 2026
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
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.
Summary
Halves the memory-derived warm pool size to prevent out-of-memory (OOM) conditions during successor provisioning.
Problem
When using a warm pool, each slot may temporarily keep both the current job VM and a provisioning successor VM alive simultaneously. The previous calculation only accounted for the memory needed by the current VMs, not the additional memory required during the provisioning window when two VMs can coexist per slot.
Solution
Modified the warm pool size calculation in
RunnerPool::runto divide the memory-derived limit by 2, properly accounting for the worst-case memory usage where each warm slot has both a running VM and a successor being provisioned.The
.max(1)ensures that at least one warm slot remains available even on memory-constrained systems.Note
Macroscope: Fix It For Me
Activity
Currently: Merged by Bnjoroge1
Previously
Note
Halve memory-derived warm pool size in
RunnerPool.runsupervisorWhen host memory is detectable, the warm pool size is now
min(config.size, max(1, on_demand_memory_cap(total, memory_mib) / 2))instead of using the raw cap. This provisions fewer warm slots to avoid OOM during successor provisioning. Risk:saturating_div(2)in lib.rs reduces the warm pool by up to half for hosts with known memory; themax(1)floor ensures at least one slot is always provisioned.Macroscope summarized 3a26f43.
Summary by cubic
Prevent OOM during successor provisioning by halving the memory-derived warm pool size. Previously we sized for one VM per warm slot; now we account for a transient second VM and guarantee at least one warm slot.
RunnerPool::run: applysaturating_div(2).max(1)toon_demand_memory_cap(...).PRELOOP_RUNNER_POOL_SIZEstill overrides.PRELOOP_RUNNER_POOL_SIZEto an explicit value.Written for commit 3a26f43. Summary will update on new commits.