noahd1 / oink

Log parser to identify actions which significantly increase VM heap size
MIT License
1.18k stars 71 forks source link

thread safety #10

Open ghazel opened 13 years ago

ghazel commented 13 years ago

Oink is currently not thread safe. The use of class variables in the ActiveRecord instrumentation allows for two threads to step on each other. Instead, Thread.current['some_key'] should be used.

noahd1 commented 13 years ago

Think this commit addresses the issue you raised, though I'm not convinced that oink is completely thread-safe otherwise. I haven't tried running oink in a multi-threaded environment. One other piece of global state I'm aware of is "@oink_extended_active_record" which is accessed/set during middleware instantiation.