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

contrib/valyala/fasthttp.v1: fix memory leak of spanOpts #2962

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

0angelic0
Copy link
Contributor

What does this PR do?

This PR fixes the memory leak of contrib/valyala/fasthttp.v1 WrapHandler function by moving the initialization of spanOpts to be in the closure anonymous function that will return as a fasthttp.RequestHandler instead of WrapHandler function. So it will be garbage collected every time the request handler end.

Motivation

Fixes #2961

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

@0angelic0 0angelic0 requested review from a team as code owners November 4, 2024 02:44
@darccio darccio added the apm:ecosystem contrib/* related feature requests or bugs label Nov 4, 2024
@darccio darccio merged commit 4d79271 into DataDog:main Nov 4, 2024
72 of 73 checks passed
@darccio
Copy link
Member

darccio commented Nov 4, 2024

@0angelic0 Thanks for contributing this fix. It'll released during this month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] contrib/valyala/fasthttp.v1 memory leak
3 participants