temporalio / temporalio/sdk-java

Make WorkflowStub#getResult timeout configurable on WorkflowOptions

Open
#652 1 comment 0 reactions 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

Right now the caller can set a timeout on getResult by working directly with WorkflowStub using the following method:
https://github.com/temporalio/sdk-java/blob/b0199150b69bb5a4eaf6c13ba4b89c2a8746a113/temporal-sdk/src/main/java/io/temporal/internal/sync/WorkflowStubImpl.java#L232

But if the caller is not using the low-level stub API and just calls the workflow method of a workflow proxy (which most of our users for sure do) a method with Integer.MAX_VALUE timeout is used by default:
https://github.com/temporalio/sdk-java/blob/b0199150b69bb5a4eaf6c13ba4b89c2a8746a113/temporal-sdk/src/main/java/io/temporal/internal/sync/WorkflowStubImpl.java#L222

We should allow defining the #getResult timeout on WorkflowOptions to allow the neat proxy API to enforce reasonable timeouts.

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 in temporal-sdk/src/main/java/io/temporal/internal/sync/WorkflowStubImpl.java at the linked getResult paths around lines 222 and 232, then trace how workflow proxies receive WorkflowOptions. Add the option's timeout through the proxy path without changing the existing low-level behavior. Done means callers can configure a reasonable getResult timeout through WorkflowOptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.