Skip to content

/concurrency: improve RunnerManager performance and readability - #143

Merged
cicoyle merged 3 commits into
dapr:mainfrom
JoshVanL:concurrency-improve
Mar 3, 2026
Merged

cicoyle merged 3 commits into
dapr:mainfrom
JoshVanL:concurrency-improve

Conversation

@JoshVanL

Copy link
Copy Markdown
Member

Refactor RunnerManager.Run to enhance robustness, performance, and readability.

Added an early return for an empty list of runners to handle edge cases more efficiently.
Buffered the error channel (errCh) with a capacity equal to the number of runners. This prevents goroutines from blocking when multiple runners complete simultaneously, leading to slight performance improvements in high-concurrency scenarios.

Refactor RunnerManager.Run to enhance robustness, performance, and
readability.

Added an early return for an empty list of runners to handle edge cases
more efficiently.
Buffered the error channel (`errCh`) with a capacity equal to the number
of runners. This prevents goroutines from blocking when multiple runners
complete simultaneously, leading to slight performance improvements in
high-concurrency scenarios.

Signed-off-by: joshvanl <me@joshvanl.dev>
Copilot AI review requested due to automatic review settings February 28, 2026 15:47
@JoshVanL
JoshVanL requested review from a team as code owners February 28, 2026 15:47

Copilot AI left a comment

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.

Pull request overview

Refactors concurrency.RunnerManager.Run to improve execution behavior under concurrency and make the control flow easier to follow.

Changes:

  • Add early return when the runner list is empty.
  • Buffer errCh to len(r.runners) to avoid runner goroutines blocking on sends.
  • Simplify runner completion/error handling and error collection loop.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread concurrency/runner.go Resolved
Comment thread concurrency/runner.go Resolved
Signed-off-by: joshvanl <me@joshvanl.dev>
Comment thread concurrency/runner.go Resolved
Signed-off-by: joshvanl <me@joshvanl.dev>
@cicoyle
cicoyle merged commit d749ae7 into dapr:main Mar 3, 2026
6 checks passed
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.

4 participants