temporalio / temporalio/sdk-java

Await on Local Activities shouldn't occupy workflow executor thread

Open
#1,346 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
433
Forks
249
Avg merge
5d 6h
Merged PRs (30d)
26

Description

Is your feature request related to a problem? Please describe.
Right now when workflow performs local activities, the workflow executor thread is retained and idling.
This is a simple solution, but it puts users in a tricky situation when they need to take into account the specific profile of their local activities when they set a number of workflow executor threads.
It also leads to a potentially uneven load and wasted resources.

Describe the solution you'd like
Workflow executor thread shouldn't actively wait for local activities completion and release the thread.

Describe alternatives you've considered

Additional context
The solution requires significant restructuring of workflow executor worker code.
Implementation should implement backpressure correctly. If Worker has a lot of workflow executor threads, but no free local activity worker threads, workflow can't make a progress and will be snowballing errors in the system.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the workflow executor worker code and tracing how local activities retain executor threads until completion. Define the backpressure behavior when local activity worker threads are unavailable, then verify that workflows make progress without executor-thread starvation or error snowballing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.