Skip to content

feat: Add a per topic pending/processing limit - #790

Open
evanh wants to merge 3 commits into
mainfrom
evan/feat/pending-processing-count-by-topic
Open

feat: Add a per topic pending/processing limit#790
evanh wants to merge 3 commits into
mainfrom
evan/feat/pending-processing-count-by-topic

Conversation

@evanh

@evanh evanh commented Aug 31, 2026

Copy link
Copy Markdown
Member

There is now a config option that can be specified in each topic config, allowing each topic to have
a maximum number of tasks in the processing/pending state. This allows a taskbroker that processes multiple
topics to limit each topic individually, without impacting the throughput of other topics.

@evanh
evanh requested a review from a team as a code owner August 31, 2026 19:08
@evanh evanh changed the title evan/feat/pending processing count by topic feat: Add a per topic pending/processing limit Aug 31, 2026
There is now a config option that can be specified in each topic config, allowing each topic to have
a maximum number of tasks in the processing/pending state. This allows a taskbroker that processes multiple
topics to limit each topic individually, without impacting the throughput of other topics.
@evanh
evanh force-pushed the evan/feat/pending-processing-count-by-topic branch from 445fafa to ded4a6c Compare August 31, 2026 19:11
Comment thread src/kafka/activation_writer.rs
Comment thread src/config/store.rs Outdated
Comment thread src/kafka/activation_writer.rs

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 76bc035. Configure here.

if let Some(topic) = topic {
query_builder.push(" AND topic = ");
query_builder.push_bind(topic);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Invalid SQL when partitions are empty

High Severity

The topic filter is always appended as AND topic = ..., but add_partition_condition adds no WHERE when the assigned partition set is empty. That produces invalid SQL, and count_depths then panics via expect. Partition revoke runs before the writer flush, so a rebalance or shutdown that clears the last assignments hits this path whenever a per-topic limit is configured.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 76bc035. Configure here.

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