temporalio / temporalio/sdk-java

Timers are still not canceled if the condition is resolved

Open
#3,012 1 comment 1 reaction 1 assignee View on GitHub

@maciejdudko is already working on this.

Since Aug 25, 2026.

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

Description

Expected Behavior

When an await with a timer resolves via the condition, the timer should be canceled.

Actual Behavior

The timer is not canceled and leaks. The workflow history is confusing.

This was already fixed behind a flag in PR https://github.com/temporalio/sdk-java/pull/2799 but the flag was never subsequently enabled by switching to tryUseSdkFlag.:

https://github.com/temporalio/sdk-java/blob/7cf35351b27a3a7af17b4fadd4d281893a96580f/temporal-sdk/src/main/java/io/temporal/internal/sync/SyncWorkflowContext.java#L1330-L1333

Also related to this is: a timer is created even if the condition is immediately satisfied at call time. See this comment: https://github.com/temporalio/sdk-java/issues/2312#issuecomment-2559296304

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.