Skip to content

fix(server): cap the event long-polls that wait at once - #175

Open
PiquelChips wants to merge 1 commit into
fix/decode-and-encode-packs-off-thefrom
fix/cap-the-event-long-polls-that
Open

PiquelChips wants to merge 1 commit into
fix/decode-and-encode-packs-off-thefrom
fix/cap-the-event-long-polls-that

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

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. Repositories now 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's sync and time features, and docs/openapi.json picks up the route's updated description.

Part of #166.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cf7d0e9f-229d-4729-bcf4-31aabe976ec9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips added this pull request to stack #185 November 22, 2026 20:21
@PiquelChips
PiquelChips removed this pull request from stack #185 November 22, 2026 20:22
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
PiquelChips force-pushed the fix/decode-and-encode-packs-off-the branch from 8dc0585 to 4767eaa Compare November 22, 2026 20:22
@PiquelChips
PiquelChips force-pushed the fix/cap-the-event-long-polls-that branch from aa4adf5 to 0e57f13 Compare November 22, 2026 20:22
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