Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information