temporalio / temporalio/temporal

Flush transient ActivityTaskStarted events before closing a workflow

Open
#2,282 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
23.2k
Forks
1.9k
Avg merge
2d 8h
Merged PRs (30d)
228

Description

Is your feature request related to a problem? Please describe.
On the attached screenshot you can find a workflow execution history that

  1. Is Closed - the workflow execution timed out
  2. An activity was started and was never finished, taking too much time. [Irrelevant, but In reality, an activity worker was killed and the activity had too long start_to_close timeout] Which caused the time out.

This history doesn't have an ActivityTaskStarted at all.
The reason is that we delay or buffer ActivityTaskStarted events till completion. Presumably to simplify processing of our state machine.
The problem is that this history looks like the activity was never ever picked up by the worker. Which makes this history very misleading and hard to debug.

Describe the solution you'd like
Flush buffered ActivityTaskStarted events before closing the workflow [completion, termination, cancellation, timeout]

Describe alternatives you've considered
Temporal may utilize marker events, but this is cumbersome if the original solution is possible.

Additional context
image

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 tracing the workflow execution history handling for buffered ActivityTaskStarted events and the paths that close a workflow by completion, termination, cancellation, or timeout. Reproduce the activity-worker timeout scenario and verify that the buffered event is present before the workflow is closed.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
distributed-systems
Issue type
Feature
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.