temporalio / temporalio/sdk-java

Metric scope for workflow instance should ignore metrics written after a destruction of the instance is requested

Open
#1,549 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected Behavior

Users should be able to use Workflow's MetricScope obtained from Workflow.getMetricsScope() in a workflow's finally blocks without accounting for DestroyWorkflowThreadError that may happen unexpectedly and uncontrollably.

Actual Behavior

DestroyWorkflowThreadError triggers finally blocks and lead to double-reporting of metrics on workflow instance eviction.

Solution

Temporal SDK should make workflow's MetricsScope aware of the fact that the instance destruction is requested and not allow any new metric's reporting in this case.

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 locating Workflow.getMetricsScope(), MetricScope reporting, and handling for DestroyWorkflowThreadError. Trace how destruction requests reach workflow finally blocks. Done means metrics written after destruction is requested are ignored, preventing double-reporting during workflow instance eviction.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, observability
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.