aws / aws-xray-sdk-go

AWS X-Ray SDK for the Go programming language.
Apache License 2.0
276 stars 117 forks source link

fix fatal error: concurrent map iteration and map write #457

Closed wangzlei closed 6 months ago

wangzlei commented 6 months ago

Issue #, if available:

If user config StreamingStrategy to be a small value and create many AWS SDK v2 subsegments, 2 goroutines would update the Segment at the same time, causes either panic: runtime error: index out of range or fatal error: concurrent map iteration and map write.

The panic has been addressed in PR https://github.com/aws/aws-xray-sdk-go/pull/419 The current PR is for addressing the fatal error.

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.