Skip to content
  • John Hawthorn's avatar
    384a4791
    Fix ServerTiming in Threads, use single subscriber · 384a4791
    John Hawthorn authored
    Previously ActionDispatch::ServerTiming would subscribe and unsubscribe
    on each request. This could cause issues with the internal stacks of
    ActiveSupport::Notifications, particlularly under the previous AS::N
    implementation which used thread-local stacks for every subscriber
    (the new implementation has mostly mitigated this).
    
    Additionally, the previous ServerTiming implementation did not report
    metrics correctly in a multi-threaded environment.
    
    This commit works around both of these issues by using a single global
    subscription, which collects events into a per-thread Array.
    384a4791
    Fix ServerTiming in Threads, use single subscriber
    John Hawthorn authored
    Previously ActionDispatch::ServerTiming would subscribe and unsubscribe
    on each request. This could cause issues with the internal stacks of
    ActiveSupport::Notifications, particlularly under the previous AS::N
    implementation which used thread-local stacks for every subscriber
    (the new implementation has mostly mitigated this).
    
    Additionally, the previous ServerTiming implementation did not report
    metrics correctly in a multi-threaded environment.
    
    This commit works around both of these issues by using a single global
    subscription, which collects events into a per-thread Array.
Loading