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

Batching activity processor #755

Merged
merged 16 commits into from
Jul 7, 2020
Merged

Batching activity processor #755

merged 16 commits into from
Jul 7, 2020

Conversation

rajkumar-rangaraj
Copy link
Contributor

@rajkumar-rangaraj rajkumar-rangaraj commented Jun 30, 2020

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

  • I ran Unit Tests locally.

@rajkumar-rangaraj rajkumar-rangaraj requested a review from a team June 30, 2020 17:34
@cijothomas cijothomas closed this Jun 30, 2020
@cijothomas cijothomas reopened this Jun 30, 2020
Copy link
Member

@reyang reyang left a 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();
Copy link
Member

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;

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants