Repository navigation
fix(server): cap the event long-polls that wait at once - #175
Open
PiquelChips wants to merge 1 commit into
Open
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Every event long-poll waits, up to a minute, on a thread of the blocking pool that every service call runs on, and nothing limited them: 512 waiting polls took the whole pool, and reads and writes queued behind them. Repositories now hands out at most 256 places for polls to wait in, each held until its poll ends. A poll that finds none free waits for one asynchronously, without a thread, for at most its own wait, which it shortens by as much, so a saturated server answers late rather than refusing, and clients need no new error.
PiquelChips
force-pushed
the
fix/decode-and-encode-packs-off-the
branch
from
November 22, 2026 20:22
8dc0585 to
4767eaa
Compare
PiquelChips
force-pushed
the
fix/cap-the-event-long-polls-that
branch
from
November 22, 2026 20:22
aa4adf5 to
0e57f13
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.
Every event long-poll waits, for up to a minute, on a thread of the blocking pool that every service call runs on, and nothing limited how many could wait. 512 waiting polls could take the whole pool and leave reads and writes queued behind them.
Repositoriesnow hands out at most 256 places for polls to wait in, and each poll holds its place until it ends. A poll that finds no free place waits for one asynchronously, without holding a thread, for at most its own wait, and that time counts toward its wait. If no place frees up in time, it answers at once with what's there. A saturated server therefore answers late instead of refusing, so clients need no new error code. Disconnecting while queued drops the wait. This turns on tokio'ssyncandtimefeatures, anddocs/openapi.jsonpicks up the route's updated description.Part of #166.
Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)