1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-06-23 00:07:52 +02:00
Files
Alec Holmes 2da77b1195 Ensure context cancellation during metric pipeline produce does not corrupt data (#6914)
This fixes issue #6344, in which an attempted clean shutdown of the
metrics SDK using PeriodicReader's Shutdown method can produce and emit
wildly incorrect data point values that are orders of magnitude too
large.

The root of the issue is that the pipeline produce method changed in
this PR cannot safely return early, which was happening in the callback
loops that were checking for context cancellation. Early return is not
safe since callbacks and aggregations are tightly coupled in practice:
invoking callbacks without also invoking aggregations corrupts internal
data point value accounting.

The linked issue more concretely walks through the sequence of steps
that were causing this issue.

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
2025-06-20 09:46:30 +02:00
..
2025-06-17 16:49:22 +02:00
2025-06-17 16:49:22 +02:00
2024-03-26 20:13:54 +01:00

SDK

PkgGoDev