Skip to content

worker: infinitely wait for start#983

Merged
sicoyle merged 5 commits into
dapr:mainfrom
JoshVanL:start-timeout-inf
Apr 21, 2026
Merged

worker: infinitely wait for start#983
sicoyle merged 5 commits into
dapr:mainfrom
JoshVanL:start-timeout-inf

Conversation

@JoshVanL
Copy link
Copy Markdown
Contributor

Instead of returning error on worker start after 10s, wait indefinitely until the worker can start or until shutdown has been signalled. This is important for environments whereby you spin up 100-500 workers at the same time and it takes some time for the cluster to settle.

Instead of returning error on worker start after 10s, wait indefinitely
until the worker can start or until shutdown has been signalled. This is
important for environments whereby you spin up 100-500 workers at the
same time and it takes some time for the cluster to settle.

Signed-off-by: joshvanl <me@joshvanl.dev>
Copilot AI review requested due to automatic review settings April 21, 2026 20:30
@JoshVanL JoshVanL requested review from a team as code owners April 21, 2026 20:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR changes the durable task gRPC worker startup behavior to wait indefinitely for the work-item stream to become available, rather than failing after a fixed 10s timeout—intended to better support environments that start hundreds of workers concurrently.

Changes:

  • Replace the fixed 10s startup wait/timeout with an indefinite poll loop.
  • Abort the startup wait if shutdown is signaled.

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

Comment thread ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/worker.py Outdated
Comment thread ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/worker.py Outdated
Signed-off-by: joshvanl <me@joshvanl.dev>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR changes the Durable Task gRPC worker startup behavior to wait indefinitely for the work-item stream to be established (instead of failing after 10 seconds), unless shutdown is signaled.

Changes:

  • Replace the fixed 10s _stream_ready wait during TaskHubGrpcWorker.start() with an indefinite retry loop that also checks for shutdown and run-loop exit.
  • Adjust TaskHubGrpcWorker.stop() to allow stopping while start() is blocked waiting for the stream.

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

Comment thread ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/worker.py Outdated
Comment thread ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/worker.py Outdated
Comment thread ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/worker.py
Comment thread ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/worker.py
Signed-off-by: joshvanl <me@joshvanl.dev>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Durable Task gRPC worker startup behavior to avoid failing after a fixed 10s window, which better supports environments that start large numbers of workers concurrently and need more time for the cluster/sidecar to become ready.

Changes:

  • Change TaskHubGrpcWorker.start() to wait indefinitely for the work-item stream to be established, while still aborting if shutdown is signaled or the run-loop thread exits.
  • Track the run-loop thread via a new instance attribute and adjust stop()’s guard to allow stop() to unblock an in-progress start().

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

Comment thread ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/worker.py
Comment thread ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/worker.py
Comment thread ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/worker.py
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.46%. Comparing base (bffb749) to head (4ef0bc2).
⚠️ Report is 107 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #983      +/-   ##
==========================================
- Coverage   86.63%   81.46%   -5.17%     
==========================================
  Files          84      139      +55     
  Lines        4473    13525    +9052     
==========================================
+ Hits         3875    11018    +7143     
- Misses        598     2507    +1909     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: joshvanl <me@joshvanl.dev>
Copy link
Copy Markdown
Contributor

@sicoyle sicoyle left a comment

Choose a reason for hiding this comment

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

thank youuuu!

@sicoyle sicoyle added this pull request to the merge queue Apr 21, 2026
Merged via the queue into dapr:main with commit 13e1e07 Apr 21, 2026
14 of 15 checks passed
@nelson-parente nelson-parente added this to the v1.18 milestone May 20, 2026
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.

5 participants