-
Notifications
You must be signed in to change notification settings - Fork 773
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
Updating ActivityProcessor #975
Updating ActivityProcessor #975
Conversation
Codecov Report
@@ Coverage Diff @@
## master #975 +/- ##
==========================================
+ Coverage 68.14% 68.19% +0.05%
==========================================
Files 218 219 +1
Lines 5983 5974 -9
Branches 978 978
==========================================
- Hits 4077 4074 -3
+ Misses 1632 1626 -6
Partials 274 274
|
updating tests updating tests - 2 updating merge updating tests - 3 updating tests - 4 using inrange instead of equal updating tests
test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs
Outdated
Show resolved
Hide resolved
test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlEventSourceTests.netfx.cs
Outdated
Show resolved
Hide resolved
@@ -2,7 +2,11 @@ | |||
|
|||
## Unreleased | |||
|
|||
* `ActivityProcessor` implements IDisposable | |||
* `ActivityProcessor` implements IDisposable. | |||
* When `Dispose` occurs, it calls `ShutdownAsync`. |
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.
Need to highlight that user should override their Dispose method, if they want to achieve custom behavior.
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.
Just updated
src/OpenTelemetry.Exporter.Jaeger/Implementation/JaegerUdpBatcher.cs
Outdated
Show resolved
Hide resolved
|
||
protected virtual void Dispose(bool disposing) | ||
{ | ||
try |
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 guess this block should only be called when disposing == true
?
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.
in our actual code, it's doing every time. So, I'm not sure.
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 think typically Close/Shutdown call goes outside of the check. Eg:
protected virtual void Dispose(bool disposing)
{
Close();
if (disposing)
{
// Free managed resources.
}
}
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.
after I moved, i saw some problems from BroadcastActivityProcessor:
protected override void Dispose(bool disposing)
{
if (disposing && !this.disposed)
{
foreach (var processor in this.processors)
{
try
{
if (processor is IDisposable disposable)
{
disposable.Dispose();
}
}
catch (Exception e)
{
OpenTelemetrySdkEventSource.Log.SpanProcessorException("Dispose", e);
}
}
this.disposed = true;
}
base.Dispose(disposing);
}
we are disposing the processors and, then, the base.dispose will call the shutdown...
I will revert to the base calling before, and we can think in another way.
…com/eddynaka/opentelemetry-dotnet into feature/updating-activity-processor
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.
Fixes #974
Changes
ActivityProcessor
now implements IDisposablePlease provide a brief description of the changes here. Update the
CHANGELOG.md
for non-trivial changes.For significant contributions please make sure you have completed the following items: