temporalio / temporalio/sdk-java

Cancelation of Local Activities

Open
#1,303 2 comments 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

Expected Behavior

I have a bunch of local activities with retry options configured that are being ran inside a cancellation scope like so:

val scope = Workflow.newCancellationScope { _ -> 
  activity1.execute()
  ....
  activityN.execute()
}
Workflow.newTimer(Duration.ofSeconds(10))
  .thenApply { scope.cancel() }

scope.run()

I expected that when scope.cancel() method is called that would close the scope with the running activities just as it works with normal activities.

Actual Behavior

Activities proceed to retry, the code after scope.run() doesn't execute

Specifications

  • Version: 1.13.0
  • Platform: Java

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 reproducing the workflow using Workflow.newCancellationScope, scope.cancel(), scope.run(), local activities, and retry options on Java SDK 1.13.0. Trace how cancellation interacts with the running activities and retries; the issue is done when cancelling the scope stops those activities and allows the code after scope.run() to execute.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.