temporalio / temporalio/sdk-java

Activities that return with interrupted flag should be successfully reported as Completed

Open
#731 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected Behavior

If Activity

  • never noticed and interrupted flag or
  • caught an interrupted exception, restored the interrupted flag, and continued to run or returned a result
    should be reported as Completed with its returned value.

Actual Behavior

According to https://github.com/temporalio/sdk-java/pull/722#discussion_r707879325
if activity returns with an interrupted flag turned on, subsequent gRPC calls fail and the Activity result never gets reported.

Proposed solution

  • We should write a stable reproducible test close to a test that was changed in https://github.com/temporalio/sdk-java/pull/722
  • When Activity returns with interrupted flag = "true", we should hide the flag, report the result of Activity execution to the server, and return the flag back after that allowing the thread pool to stop.

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 with the test changed by temporalio/sdk-java PR #722 and create a stable reproduction where an Activity returns while the interrupted flag is true. Verify that the Activity result is reported as Completed with its returned value, while the interrupted flag is restored afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
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.