scout_apm_ruby icon indicating copy to clipboard operation
scout_apm_ruby copied to clipboard

Scout causes Puma to run the on_worker_boot block twice

Open adriano-tirloni opened this issue 5 years ago • 2 comments

scout_apm (2.4.21) Scout is causing Puma to execute the on_worker_boot twice, only when preloading is turned on on puma. This file (https://github.com/scoutapp/scout_apm_ruby/blob/master/lib/scout_apm/server_integrations/puma.rb) gave me the hint by logging I, [2019-03-07T16:47:33.844521 #186] INFO -- : Installing Puma worker loop. when I tought it was a Puma configuration issue. Production or Development env is the same. If i remove the gem and bundle it stops running twice.

preload off

[225] Puma starting in cluster mode... [225] * Version 3.12.0 (ruby 2.5.1-p57), codename: Llamas in Pajamas [225] * Min threads: 0, max threads: 1 [225] * Environment: development [225] * Process workers: 1 [225] * Phased restart available [225] * Listening on tcp://0.0.0.0:3000 [225] Use Ctrl-C to stop --before_fork-start --before_fork-end worker 0=>--on_worker_fork-- worker 0=>--after_worker_fork-- worker 0=>--on_worker_boot-- [225] - Worker 0 (pid: 228) booted, phase: 0 ... [225] - Gracefully shutting down workers... worker 0=>--on_worker_shutdown-- [225] === puma shutdown: 2019-03-07 16:57:53 +0000 === [225] - Goodbye!

preload on

[275] Puma starting in cluster mode... [275] * Version 3.12.0 (ruby 2.5.1-p57), codename: Llamas in Pajamas [275] * Min threads: 0, max threads: 1 [275] * Environment: development [275] * Process workers: 1 [275] * Preloading application [275] * Listening on tcp://0.0.0.0:3000 [275] Use Ctrl-C to stop --before_fork-start --before_fork-end worker 0=>--on_worker_fork-- worker 0=>--after_worker_fork-- worker 0=>--on_worker_boot-- I, [2019-03-07T17:01:58.601184 #278] INFO -- : Installing Puma worker loop. worker 0=>--on_worker_boot-- [275] - Worker 0 (pid: 278) booted, phase: 0 ... [275] - Gracefully shutting down workers... worker 0=>--on_worker_shutdown-- [275] === puma shutdown: 2019-03-07 17:02:03 +0000 === [275] - Goodbye!

adriano-tirloni avatar Mar 07 '19 17:03 adriano-tirloni

Thank you for the report, I'll take a look at it. Is it causing you any immediate issues?

cschneid avatar Mar 07 '19 18:03 cschneid

@cschneid Not at moment.

adriano-tirloni avatar Mar 07 '19 18:03 adriano-tirloni

We ran into this issue as well, and I've opened a PR to work around this here: https://github.com/scoutapp/scout_apm_ruby/pull/463

rubiety avatar Nov 22 '22 00:11 rubiety

Closed by https://github.com/scoutapp/scout_apm_ruby/pull/463 and released in 5.3.3

dlanderson avatar Dec 09 '22 03:12 dlanderson

Thanks @rubiety !

dlanderson avatar Dec 09 '22 03:12 dlanderson