-
Notifications
You must be signed in to change notification settings - Fork 772
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
Batching activity processor #755
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
{ | ||
if (!this.stopping) | ||
{ | ||
this.ShutdownAsync(CancellationToken.None).ContinueWith(_ => { }).GetAwaiter().GetResult(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could introduce exception which is against the .NET guideline: The object must not throw an exception if its Dispose method is called multiple times.
Reason: ShutdownAsync
is not thread safe, race condition could happen for this.stopping
, which would re-enter the following code with this.cts == null
:
this.cts.Cancel(false);
this.cts.Dispose();
this.cts = null;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's with ContinueWith(_ => { })
is that to suppress any exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This will suppress an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@reyang @CodeBlanch @cijothomas
We have similar dispose pattern in SimpleSpanProcessor, SimpleActivityProcessor, BatchingSpanProcessor. Should we create a new issue to address it? or we consider fixing as a part of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd open a new issue and merge this one. So that we can make progress and keep track of fixing the underlying issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created an issue #769 to track it.
Changes
Adds a batching activity processor.
Added exporterTimeout #578
As #697 is inactive, created this new PR to add batching activity processor and fixed tests
Checklist