Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: memory leak fasthttp handler #311

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

nicolascb
Copy link
Contributor

We can't use fasthttp.RequestCtx in NewSegmentFromHeader, this generated an infinite wait in xray/segment.go#L135, because fasthttp.RequestCtx.Done() is not called after finishing the request.

The solution was to create a new context to pass to NewSegmentFromHeader.

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

We can't use fasthttp.RequestCtx in NewSegmentHeader, this
generated an infinite wait in xray/segment.go#L135, because
fasthttp.RequestCtx.Done() is not called after finishing the request.

The solution was to create a new context to pass to NewSegmentHeader.
@nicolascb
Copy link
Contributor Author

@bhautikpip We depend on this change to put X-Ray into production, can you help me? :D

@bhautikpip
Copy link
Contributor

Sure. taking a look!

@bhautikpip bhautikpip self-requested a review June 16, 2021 15:52
Copy link
Contributor

@bhautikpip bhautikpip left a comment

Choose a reason for hiding this comment

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

Looks good :)

@bhautikpip bhautikpip merged commit 25916b1 into aws:master Jun 16, 2021
@nicolascb nicolascb deleted the fix/memory-leak-fasthttp branch June 18, 2021 14:59
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.

2 participants