Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time-skipping past activity’s startToCloseTimeout causes worker not to close #2246

Open
ikonst opened this issue Oct 1, 2024 · 0 comments

Comments

@ikonst
Copy link

ikonst commented Oct 1, 2024

Expected Behavior

worker.runUntil returns shortly after workflow ends

Actual Behavior

  • worker.runUntil usually hangs, ostensibly because it fails to wait for the abandoned activity
  • Logged SDK warning:
    WARN temporal_sdk_core::worker::activities: Activity not found on completion. This may happen if the activity has already been cancelled but completed anyway. task_token=TaskToken(<activity's token>) details=Status { code: NotFound, message: "invalid activityID or activity already timed out or invoking workflow is completed", metadata: MetadataMap { headers: {"content-type": "application/grpc"} }, source: None }
    

Steps to Reproduce the Problem

Pardon my TypeScript...

Assume activity foo:

export async function foo() {
}

and workflow workflow:

const { foo } = proxyActivities<typeof activities>({ startToCloseTimeout: "60 seconds" });

export async function workflow() {
  await foo();
}

And let this be the test:

test("foo", async () => {
  testEnv = await TestWorkflowEnvironment.createTimeSkipping();
  worker = Worker.create({
    connection: testEnv.nativeConnection,
    ...
  });

  let waited = false;
  const worker = await createWorker({
    activities: {
      foo: async function() { 
        if (!waited) {
          await testEnv.sleep("61 seconds");
          waited = true;
        }
      }
    },
  });
  
  await worker.runUntil(testEnv.client.workflow.execute(workflow, {}));
  // ^ gets stuck here:
});

Specifications

  • Version: TypeScript SDK 1.11.1
  • Platform: MacOS

Discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant