Skip to content

Recycle workers with bad init times - #176

Draft
christiangnrd wants to merge 1 commit into
slowwarnfrom
init
Draft

Recycle workers with bad init times#176
christiangnrd wants to merge 1 commit into
slowwarnfrom
init

Conversation

@christiangnrd

@christiangnrd christiangnrd commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Increasing init times usually means macOS is under too much memory pressure, this should help prevent pathological increase in GC time before starting a new testset on a worker.

Keeps track of the lowest non-custom worker init and if a test took longer than double that time, recycle it. In verbose mode, init time turns yellow when a worker is to be recycled for this reason

One design question is if we should expose the init time multiplier value as an argument to runtests. I'm leaning towards no

@christiangnrd
christiangnrd marked this pull request as draft September 2, 2026 18:24
Base automatically changed from yellow to main September 3, 2026 11:23
@christiangnrd
christiangnrd force-pushed the init branch 3 times, most recently from c6603ff to 82f1823 Compare September 3, 2026 13:22
@christiangnrd
christiangnrd changed the base branch from main to ptrptr September 3, 2026 13:28
Base automatically changed from ptrptr to main September 8, 2026 16:02
@christiangnrd
christiangnrd force-pushed the init branch 2 times, most recently from 2fbeb01 to f8af12b Compare September 11, 2026 13:00
@christiangnrd
christiangnrd removed this pull request from stack #180 September 11, 2026 13:03
@christiangnrd
christiangnrd changed the base branch from main to slowwarn September 11, 2026 13:03
@christiangnrd
christiangnrd added this pull request to stack #184 September 11, 2026 13:03
…tart

The slow init warning already tracks the cost of a fresh worker: once a warm
init exceeds SLOW_INIT_FACTOR times that, spawning a new worker is cheaper than
keeping the bloated heap of the current one (e.g. under macOS memory pressure,
issue #124). Recycle such pool workers in addition to warning, print the worker
id and the offending init time in yellow, and extend the slow init testset to
check the recycle and the output.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant