Closed narqo closed 2 years ago
🆙
@bhautikpip I've push the updated version, PHAL
@bhautikpip, I've noticed that the CI went red after your approval. Apparently, some unit tests in the package relied on the global state. So the unit-test, that I'd added earlier started to interfere with the old ones. I've added one more commit to the PR to make at least my tests better 🙏
@bhautikpip is there anything blocking from merging this PR, or anything I could help to move this forward?
Issue #, if available: This is a follow-up for https://github.com/aws/aws-xray-sdk-go/issues/51 and https://github.com/aws/aws-xray-sdk-go/pull/156
Description of changes: https://github.com/aws/aws-xray-sdk-go/pull/156 has fixed a leak caused by the use of
context.Background()
withxray.BeginSegmentWithSampling
. This won't work if a service's background job, uses a context, whose cancellation is bound to service's life-time. E.g. consider the following code:This PR aims at fixing the issue by making sure the goroutine, that
xray.BeginSegment
spawns will be stopped after the segment gets closed.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.