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

[Tracing Framework] Fix parent span setting in case multiple tasks are created from a single thread #8428

Closed
Tracked by #7542
Gaganjuneja opened this issue Jul 4, 2023 · 0 comments · Fixed by #8831
Labels
distributed framework enhancement Enhancement or improvement to existing feature or request

Comments

@Gaganjuneja
Copy link
Contributor

Gaganjuneja commented Jul 4, 2023

Is your feature request related to a problem? Please describe.
Addresses the issue with code change #7543
For an instance where multiple tasks are being submitted from a loop the parent span is getting wrongly set.

Example :-
Parent - A

for(int i=0; i<array["B", "C", "D", "E"].length; i++){
       performPhaseOnShard(array[i]);
}

performPhaseOnShard executes the phase on the node where the shard is located, it could be locally or external data node. If we start a span from inside the performPhaseOnShard method, it creates the shard and sets this newly created span as a parent for the future spans. E.x here

  1. performPhaseOnShard for shard B will have parent span as A.
  2. performPhaseOnShard for shard C will have parent span as B. Which is wrong and should ideally be A
  3. Similarly, performPhaseOnShard for shard C will have a parent span as C.

Describe the solution you'd like
Ideally we need to reset the context in this scenario, so Tracer should provide a new Releasable TracerContext which can be reset to the original one of releasing the current context.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@Gaganjuneja Gaganjuneja added enhancement Enhancement or improvement to existing feature or request untriaged labels Jul 4, 2023
@Gaganjuneja Gaganjuneja changed the title [Tracing Framework] Add support for multiple tasks getting created from a single thread [Tracing Framework] Fix parent span setting in case multiple tasks are created from a single thread Jul 4, 2023
@reta reta closed this as completed in #8831 Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distributed framework enhancement Enhancement or improvement to existing feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants