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 in the curb instrumentation #1518

Merged
merged 1 commit into from
Oct 4, 2022

Commits on Oct 4, 2022

  1. Fix memory leak in the curb instrumentation

    On long-running connection Curb use-cases like
    Elasticsearch clients with Curb transport the `request` variable
    points to the same Curb object not just for one request but for all.
    
    Therefore, for each succesful request following the first one,
    `original_callback` points to the previous on_failure callback set by newrelic.
    So, an infinite chain of callbacks is created since newrelic's on_failure
    callback maintains a reference to `original_callback`.
    
    The changes force `original_callback` to point to the actual original callback on
    subsequent requests instead of pointing to the newrelic's callback.
    That way no reference is maintained for newrelic's callback of the
    previous request & the memory leak is prevented by the GC.
    charkost committed Oct 4, 2022
    Configuration menu
    Copy the full SHA
    a6bcceb View commit details
    Browse the repository at this point in the history