temporalio / temporalio/sdk-java
OpenTracing duplicates user created spans during replay
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 433
- Forks
- 249
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 26
Description
Expected Behavior
If we have the following code somewhere in workflow:
void execute() {
...
withSpan(() -> {
activity.runActivity();
})
...
//end of replay somewhere down from the above code block
}
If we replay the code above, we should ignore the span creation, because this span was already reported during the original execution.
Actual Behavior
The second span will be created during replay.
Proposed solution
We should create a thin layer on top of Tracer, ScopeManager, Scope or Span that will check if we are still replaying on span finalization and if we are - discard the span instead of finalizing it.
Notes
The issue is raised here:
#951
https://github.com/temporalio/sdk-java/pull/951#pullrequestreview-844189585
And the solution is originally proposed here:
https://github.com/temporalio/sdk-java/pull/951#issuecomment-1005896960
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the withSpan example and the proposed Tracer, ScopeManager, Scope, and Span layer, then read issue #951 and its linked pull-request review and comment. Trace span finalization during workflow replay; done means spans created during replay are discarded instead of finalized.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100