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

Make the SDK more forgiving for ObjectDisposedException #3291

Merged
merged 3 commits into from May 19, 2022

Conversation

reyang
Copy link
Member

@reyang reyang commented May 19, 2022

Fixes #3269.

I guess 99% of the cases it was due to the user's fault - e.g. LoggerProvider disposed before worker threads join, MeterProvider disposed while the Exporter is still busy. The rest 1% came from the underlying libraries/frameworks that the user has no control over (e.g. the framework doesn't have a proper shutdown mechanism).

Anyways I think the OpenTelemetry design principle encourages the SDK to be more forgiving after the initialization succeeded.

@reyang reyang requested a review from a team as a code owner May 19, 2022 16:36
@reyang
Copy link
Member Author

reyang commented May 19, 2022

FYI @ppumkin.

Copy link
Member

@CodeBlanch CodeBlanch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #3291 (93777d2) into main (eb8844a) will increase coverage by 0.17%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3291      +/-   ##
==========================================
+ Coverage   85.41%   85.59%   +0.17%     
==========================================
  Files         263      263              
  Lines        9487     9501      +14     
==========================================
+ Hits         8103     8132      +29     
+ Misses       1384     1369      -15     
Impacted Files Coverage Δ
src/OpenTelemetry/BatchExportProcessor.cs 81.90% <50.00%> (-5.47%) ⬇️
...Telemetry/Metrics/PeriodicExportingMetricReader.cs 72.72% <50.00%> (-3.75%) ⬇️
...emetry.Api/Internal/OpenTelemetryApiEventSource.cs 76.47% <0.00%> (-5.89%) ⬇️
...nTelemetry/Internal/OpenTelemetrySdkEventSource.cs 76.72% <0.00%> (+2.58%) ⬆️
...metryProtocol/Implementation/ActivityExtensions.cs 95.62% <0.00%> (+4.37%) ⬆️
...lemetry/Internal/SelfDiagnosticsConfigRefresher.cs 92.30% <0.00%> (+5.76%) ⬆️
...xporter.OpenTelemetryProtocol/OtlpTraceExporter.cs 77.27% <0.00%> (+18.18%) ⬆️
...entation/ExportClient/OtlpGrpcTraceExportClient.cs 78.57% <0.00%> (+28.57%) ⬆️
... and 1 more

@p10tyr
Copy link

p10tyr commented May 20, 2022

Amazing thank you very much !

When will this be available. I guess its going to be in OpenTelemetry.Exporter.OpenTelemetryProtocol.Logs package still?
Once that is out I can release and turn on again to see what happens in the wild

@reyang reyang deleted the reyang/salvation branch May 20, 2022 16:26
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.

An error occurred while writing to logger(s) - Safe handle has been closed
4 participants