Skip to content

Move broadcaster backpressure from task-level to stream-level#25325

Merged
nickvikeras merged 2 commits intomainfrom
nickv/dynamic-concurrency-control-2
Feb 7, 2026
Merged

Move broadcaster backpressure from task-level to stream-level#25325
nickvikeras merged 2 commits intomainfrom
nickv/dynamic-concurrency-control-2

Conversation

@nickvikeras
Copy link
Copy Markdown
Contributor

@nickvikeras nickvikeras commented Feb 6, 2026

Description

Previously, each spawned fetch task independently waited on ingest_hi inside itself, meaning tasks were already spawned and consuming resources while blocked on backpressure. Now checkpoints are gated at the stream level via backpressured_checkpoint_stream(), so tasks are only spawned when the backpressure window allows.

Without this change, it's impossible to let adaptive concurrency limiters find the upper bound for object store ingestion, because we will just keep spinning up futures (that are blocked on backpressure) until we OOM.

Test plan

I have tested it during a testnet backfill as part of a larger effort to enable adaptive rate limiting.

Release notes

  • Indexing Framework: Fix memory leak in ingestion stream.

@nickvikeras nickvikeras temporarily deployed to sui-typescript-aws-kms-test-env February 6, 2026 15:51 — with GitHub Actions Inactive
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview, Comment Feb 7, 2026 5:39pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Feb 7, 2026 5:39pm
sui-kiosk Ignored Ignored Preview Feb 7, 2026 5:39pm

Request Review

@nickvikeras nickvikeras marked this pull request as ready for review February 6, 2026 15:53
@nickvikeras nickvikeras requested a review from a team as a code owner February 6, 2026 15:53
@nickvikeras nickvikeras temporarily deployed to sui-typescript-aws-kms-test-env February 6, 2026 15:53 — with GitHub Actions Inactive
Base automatically changed from nickv/dynamic-concurrency-control-1 to main February 6, 2026 17:24
@nickvikeras nickvikeras force-pushed the nickv/dynamic-concurrency-control-2 branch from 062f477 to 4b0d9e2 Compare February 6, 2026 18:59
@nickvikeras nickvikeras temporarily deployed to sui-typescript-aws-kms-test-env February 6, 2026 18:59 — with GitHub Actions Inactive
Previously, each spawned fetch task independently waited on ingest_hi
inside itself, meaning tasks were already spawned and consuming resources
while blocked on backpressure. Now checkpoints are gated at the stream
level via backpressured_checkpoint_stream(), so tasks are only spawned
when the backpressure window allows.
@nickvikeras nickvikeras force-pushed the nickv/dynamic-concurrency-control-2 branch from 4b0d9e2 to 3d5dbd1 Compare February 6, 2026 22:26
@nickvikeras nickvikeras temporarily deployed to sui-typescript-aws-kms-test-env February 6, 2026 22:26 — with GitHub Actions Inactive
Copy link
Copy Markdown
Contributor

@amnn amnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change -- this does really motivate updating the backpressure system to be the same for concurrent and sequential pipelines.

stream::iter(start..end)
// Backpressure is enforced at the stream level: checkpoints are only yielded when
// ingest_hi allows, preventing spawned tasks from piling up while blocked.
let checkpoints = backpressured_checkpoint_stream(start, end, ingest_hi_rx);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit (optional): inline this?

@nickvikeras nickvikeras temporarily deployed to sui-typescript-aws-kms-test-env February 7, 2026 17:36 — with GitHub Actions Inactive
@nickvikeras nickvikeras enabled auto-merge (squash) February 7, 2026 17:36
@nickvikeras nickvikeras merged commit b993a80 into main Feb 7, 2026
56 of 59 checks passed
@nickvikeras nickvikeras deleted the nickv/dynamic-concurrency-control-2 branch February 7, 2026 17:57
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.

3 participants