Skip to content

enhance WorkflowRuntime and WorkflowRuntimeBuilder with close handlig and lifecycle management - #1816

Merged
javier-aliaga merged 1 commit into
dapr:masterfrom
matheusandre1:issue1734
Oct 1, 2026
Merged

javier-aliaga merged 1 commit into
dapr:masterfrom
matheusandre1:issue1734

Conversation

@matheusandre1

Copy link
Copy Markdown
Contributor

Description

two problems that prevented a clean full restart of WorkflowRuntime (for example on a Quarkus dev-mode live reload or between tests)

  • WorkflowRuntime.close() blocked for the full 60 second channel timeout. The channel was shut down gracefully while the worker thread still held the getWorkItems stream open, so awaitTermination never returned early.
  • WorkflowRuntimeBuilder.build() kept returning the closed runtime. The static singleton was never released, so a new builder got back the old instance whose channel was already shut down.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Closes: #1734

Related: #1631 (closeNow() proposal, PR #1632) and PR #1727, which fixed the worker loop exit but not this blocking.

RELEASE NOTE: FIX WorkflowRuntime.close() no longer blocks on the open work-item stream, and WorkflowRuntimeBuilder.build() returns a new runtime after the previous one was closed.

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@matheusandre1
matheusandre1 force-pushed the issue1734 branch 2 times, most recently from 854479c to 11f538b Compare September 30, 2026 17:51
…g and lifecycle management

Signed-off-by: Matheus André <matheusandr2@gmail.com>
@matheusandre1
matheusandre1 marked this pull request as ready for review September 30, 2026 19:02
@matheusandre1
matheusandre1 requested review from a team as code owners September 30, 2026 19:02
@codecov

codecov Bot commented Sep 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.09%. Comparing base (d5c3c62) to head (447544c).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1816      +/-   ##
============================================
+ Coverage     78.99%   79.09%   +0.09%     
- Complexity     2591     2600       +9     
============================================
  Files           264      264              
  Lines          7770     7778       +8     
  Branches        815      818       +3     
============================================
+ Hits           6138     6152      +14     
+ Misses         1269     1266       -3     
+ Partials        363      360       -3     

☔ View full report in Codecov by Harness.
📢 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.

@javier-aliaga
javier-aliaga merged commit 12c88cf into dapr:master Oct 1, 2026
23 of 24 checks passed
@matheusandre1
matheusandre1 deleted the issue1734 branch October 1, 2026 13:53
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.

Allow clean full restart of WorkflowRuntime

2 participants