dd-trace-rb icon indicating copy to clipboard operation
dd-trace-rb copied to clipboard

Extract context clearing logic for ActiveSupport events

Open marcotc opened this issue 5 years ago • 2 comments

When gems that utilize thread pools are instrumented it is very important to ensure that the thread-bound Context does not leak information between executions.

We have existing logic to clear the Context for a few integrations that instrument using ActiveSupport events.

This PR extracts that logic to a central place, adds a health metric to count how many times the context is leaking and cleans up testing for integrations affected.

marcotc avatar Dec 20 '19 22:12 marcotc

Now that #824 has been merged, I'm rebasing this on master instead.

marcotc avatar Jan 06 '20 20:01 marcotc

Rebased, ready for review again.

marcotc avatar Jan 06 '20 21:01 marcotc