-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change handles the edge case exposed in our tests where the agent may fail to inject the cache naming function at enable because it looked for drupal and symfony classes before composer autoload had time to load them. In the normal flow, this would only be a temporary problem since nr_drupal_enable should be re-run every request, and subsequent requests should have these resources available. Our test setup, however, shows that if in the process of handling one request, another request is generated and the agent doesn't re-trigger RINIT processing, the function name from the first request will bleed through to the second request and result in an incorrect name. To fix, extract logic responsible for injecting the cache naming function to its own function and call both at enable and within the PageCache::get function instrumentation, provided the injection function (newrelic_name_cached) is not detected when we look for it. This should strike the best balance between performance and correctness.
- Loading branch information
1 parent
04cbaf6
commit 17a32d3
Showing
1 changed file
with
76 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters