1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-03 22:52:30 +02:00

Fix race condition in reading the dropped spans number (#2615)

* Fix race condition in reading the dropped spans number

As any race condition this should be consider an undefined behavior, and a patch release should be done.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
Bogdan Drutu 2022-02-16 09:00:31 -08:00 committed by GitHub
parent cd21df42c4
commit 2a9cedf5fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased]
### Fixed
- Fix race condition in reading the dropped spans number. (#2615)
## [1.4.0] - 2022-02-11
### Added

View File

@ -250,7 +250,7 @@ func (bsp *batchSpanProcessor) exportSpans(ctx context.Context) error {
}
if l := len(bsp.batch); l > 0 {
global.Debug("exporting spans", "count", len(bsp.batch), "dropped", bsp.dropped)
global.Debug("exporting spans", "count", len(bsp.batch), "dropped", atomic.LoadUint32(&bsp.dropped))
err := bsp.e.ExportSpans(ctx, bsp.batch)
// A new batch is always created after exporting, even if the batch failed to be exported.