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

Revise dispose pattern in SpanProcessor/ActivityProcessor #769

Closed
rajkumar-rangaraj opened this issue Jul 6, 2020 · 2 comments · Fixed by #853
Closed

Revise dispose pattern in SpanProcessor/ActivityProcessor #769

rajkumar-rangaraj opened this issue Jul 6, 2020 · 2 comments · Fixed by #853
Labels
bug Something isn't working pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Comments

@rajkumar-rangaraj
Copy link
Contributor

Dispose pattern in SimpleSpanProcessor, SimpleActivityProcessor, BatchingSpanProcessor and BatchingActivityProcessor needs to be revised. As @reyang mentioned ShutdownAsync is not thread safe, race condition could happen for this.stopping, and it would re-enter to re-execute the same code.

Raised as a part of PR: #755 (comment)

@rajkumar-rangaraj rajkumar-rangaraj added the bug Something isn't working label Jul 6, 2020
@reyang reyang added pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package release:required-for-ga labels Jul 18, 2020
@eddynaka
Copy link
Contributor

@reyang , for this, do you think a simple lock in a variable in the dispose method would work? Or do you have something else in your mind?

@reyang
Copy link
Member

reyang commented Jul 18, 2020

Yes, a simple lock should solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package
Projects
None yet
3 participants