Repository navigation
Conversation
A recycle drained the worker first: it took no new sessions until all open sessions ended or DRAIN_TIMEOUT expired, so one slow session stopped the worker's capacity at each recycle. The worker now starts the new browser at once, sends new sessions to it, and closes the old browser after its last session ends or DRAIN_TIMEOUT expires. The session budget counts accepted sessions, so the recycle starts when the budget is spent. If the budget runs out again while the old browser is still open, the worker renews the budget and keeps the current browser, so it never runs more than two browsers. SIGTERM still drains and exits.
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.
When a worker reached
MAX_LIFETIME_SESSIONS, it stopped taking new sessions until every open session ended orDRAIN_TIMEOUTexpired. One slow session could stop the worker's capacity for the full drain timeout at each recycle (300 s by default), and with one worker, all capacity stopped.Now a recycle starts the new browser at once and keeps the worker available. Open sessions finish on the old browser, which closes after its last session ends or when
DRAIN_TIMEOUTexpires. The session budget counts accepted sessions, so the recycle starts as soon as the budget is spent. A worker runs at most two browsers: if the budget runs out again while the old browser is still open, the current browser keeps serving and recycles at a later limit.SIGTERMstill drains and exits, also when it arrives during a recycle. No configuration changes.Verified with one worker (
MAX_SLOTS=3,MAX_LIFETIME_SESSIONS=10,DRAIN_TIMEOUT=30), one 45 s session, and short sessions for 60 s:mainserved 499 sessions with 2 failed after a 30 s wait; this branch served 1320 with 0 failures, a 137 ms maximum, and at most two browsers. Worker, server, and website checks pass, and the local Compose smoke test recycled Chromium, Firefox, and WebKit workers.