Skip to content

Wait executor should use provided executor rather than global one#1482

Merged
fjtirado merged 1 commit into
serverlessworkflow:mainfrom
fjtirado:wait_on_thread
Jun 24, 2026
Merged

Wait executor should use provided executor rather than global one#1482
fjtirado merged 1 commit into
serverlessworkflow:mainfrom
fjtirado:wait_on_thread

Conversation

@fjtirado

Copy link
Copy Markdown
Collaborator

completeOnTimeoput uses a global internal thread.
This PR change WaitExecutor implementation to use the provided Applicaiton.ExecutorService

Signed-off-by: fjtirado <ftirados@ibm.com>
Copilot AI review requested due to automatic review settings June 24, 2026 09:18

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

This PR updates the WaitExecutor implementation so that the wait-completion work is executed using the WorkflowApplication-provided ExecutorService, instead of relying on the default/global executor behavior from CompletableFuture.completeOnTimeout.

Changes:

  • Replaced completeOnTimeout(...) with an explicit CompletableFuture plus a delayed execution path that targets workflow.definition().application().executorService().
  • Adjusted the wait completion logic to complete the returned future via an executor-scheduled runnable.

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

@fjtirado fjtirado merged commit 2af31a0 into serverlessworkflow:main Jun 24, 2026
3 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.

2 participants