Skip to content

Conversation

@shuangkun
Copy link
Member

Fixes #14791

Motivation

This PR introduces a wfThrottleQueue to accelerate event handling in the workflow controller, similar to PR #13419.

The current implementation processes all workflow events through a single queue, which can become a bottleneck under high load. By adding a dedicated throttle queue, we can decouple event reception from processing and improve overall throughput.

Modifications

  • Added wfThrottleQueue: New dedicated queue for throttle operations in WorkflowController
  • Created throttle key utilities: New workflow/sync/throttle_key.go with type-safe ThrottleAction constants
  • Updated event handlers: Modified AddFunc, UpdateFunc, and DeleteFunc to use throttle queue
  • Added throttle worker: New runThrottleWorker() and processNextThrottleItem() methods
  • Enhanced throttler integration: Updated throttler callback to work with the new queue system
  • Added comprehensive tests: Unit tests for throttle key functions and updated controller tests
  • Added CLI parameter: New --workflow-throttle-workers flag (default: 8 workers)

Verification

Documentation

shuangkun and others added 5 commits September 21, 2025 18:56
Co-authored-by: lons <[email protected]>
Co-authored-by: shuangkun <[email protected]>
Signed-off-by: shuangkun <[email protected]>
Co-authored-by: lons <[email protected]>
Co-authored-by: shuangkun <[email protected]>
Signed-off-by: shuangkun <[email protected]>
Signed-off-by: shuangkun <[email protected]>
Signed-off-by: shuangkun <[email protected]>
Signed-off-by: shuangkun <[email protected]>
@shuangkun
Copy link
Member Author

/retest

1 similar comment
@shuangkun
Copy link
Member Author

/retest

@shuangkun shuangkun added the area/controller Controller issues, panics label Sep 23, 2025
Signed-off-by: shuangkun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/controller Controller issues, panics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add throttle queue to speed up processing

1 participant