Repository navigation
refactor(client): share startup attempt bookkeeping between clients - #53240
Merged
Merged
Conversation
kitlangton
force-pushed
the
share-service-probe
branch
from
October 5, 2026 04:00
90e5ee6 to
e5f9b7a
Compare
kitlangton
force-pushed
the
share-contender-pool
branch
from
October 5, 2026 04:00
d9defe8 to
42dc009
Compare
This was referenced Oct 5, 2026
kitlangton
force-pushed
the
share-service-probe
branch
from
October 5, 2026 04:54
e5f9b7a to
7e91214
Compare
kitlangton
force-pushed
the
share-contender-pool
branch
from
October 5, 2026 04:54
42dc009 to
8d52db1
Compare
kitlangton
force-pushed
the
share-contender-pool
branch
from
October 5, 2026 06:00
8d52db1 to
9907f16
Compare
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.
Why
Both
ensure()loops track their startup attempts with the same four variables (contenders,failure,spawnDelay,lastSpawn) and the same 25 lines of rules. #50784 had to change those rules identically in both clients, and nothing but review kept them in sync.What Changes
contenderPool(timing)inservice-contender.tsowns that bookkeeping. Each client keeps its own IO (announcing, spawning,terminate,stop) and calls the pool at the same points as before.serviceAnswered()spawnDelay = timing.spawnDelaywhen a registered service answersevict(pid)failure = undefined,lastSpawn = 0recruitNow()lastSpawn = Date.now() - spawnDelayafter killing an unresponsive ownerreap()shouldRecruit(registered)add(contender),releaseAll(),failure()contenders.add+lastSpawn = Date.now(), the final release, the timeout errorOne ordering moved: the old loop started the "unanswered registration" clock before reaping, and the pool starts it inside
shouldRecruit(), afterreap(). Nothing reads the clock in between, and the only path that skips it is the fatal one, which leavesensure().Scope
Stacked on #53237. A pure move of #50784's rules, with no behavior change intended. Next: the decision
ensure()makes when a registered service answers.Verification
service-contender-pool.test.tsexercises the pool with real short-livedbun -eprocesses: retained first failure, eviction, the unanswered-registration delay, the two-attempt limit, capped backoff, and the backoff reset when a service answers.Stack