Skip to content

Make the SDK more forgiving for ObjectDisposedException#3291

Merged
cijothomas merged 3 commits into
open-telemetry:mainfrom
reyang:reyang/salvation
May 19, 2022
Merged

Make the SDK more forgiving for ObjectDisposedException#3291
cijothomas merged 3 commits into
open-telemetry:mainfrom
reyang:reyang/salvation

Conversation

@reyang

@reyang reyang commented May 19, 2022

Copy link
Copy Markdown
Member

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 May 19, 2022 16:36
@reyang

reyang commented May 19, 2022

Copy link
Copy Markdown
Member Author

FYI @ppumkin.

@CodeBlanch CodeBlanch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@codecov

codecov Bot commented May 19, 2022

Copy link
Copy Markdown

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

p10tyr commented May 20, 2022

Copy link
Copy Markdown

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