Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: calling GoodJob.restart in Puma on_worker_boot still starts GoodJob regardless of it being in async mode or not #1531

Open
amanfredi opened this issue Oct 30, 2024 · 2 comments

Comments

@amanfredi
Copy link

Thanks for the great work on GoodJob!

This issue was originally reported in #1054 and reported fixed in #1055.

This fix doesn't seem to work properly. In puma on_worker_boot my caller stack looks like this:

["/opt/gems/ruby/3.3.0/gems/puma-6.4.3/lib/puma/configuration.rb:320:in `block in run_hooks'", "/opt/gems/ruby/3.3.0/gems/puma-6.4.3/lib/puma/configuration.rb:314:in `each'", "/opt/gems/ruby/3.3.0/gems/puma-6.4.3/lib/puma/configuration.rb:314:in `run_hooks'", "/opt/gems/ruby/3.3.0/gems/puma-6.4.3/lib/puma/cluster/worker.rb:57:in `run'", "/opt/gems/ruby/3.3.0/gems/puma-6.4.3/lib/puma/cluster.rb:216:in `worker'", "/opt/gems/ruby/3.3.0/gems/puma-6.4.3/lib/puma/cluster.rb:97:in `block in spawn_worker'", "/opt/gems/ruby/3.3.0/gems/puma-6.4.3/lib/puma/cluster.rb:97:in `fork'", "/opt/gems/ruby/3.3.0/gems/puma-6.4.3/lib/puma/cluster.rb:97:in `spawn_worker'", "/opt/gems/ruby/3.3.0/gems/puma-6.4.3/lib/puma/cluster.rb:81:in `block in spawn_workers'", "<internal:numeric>:237:in `times'", "/opt/gems/ruby/3.3.0/gems/puma-6.4.3/lib/puma/cluster.rb:74:in `spawn_workers'", "/opt/gems/ruby/3.3.0/gems/puma-6.4.3/lib/puma/cluster.rb:430:in `run'", "/opt/gems/ruby/3.3.0/gems/puma-6.4.3/lib/puma/launcher.rb:194:in `run'", "/opt/gems/ruby/3.3.0/gems/puma-6.4.3/lib/puma/cli.rb:75:in `run'", "/opt/gems/ruby/3.3.0/gems/puma-6.4.3/bin/puma:10:in `<top (required)>'", "/opt/gems/ruby/3.3.0/bin/puma:25:in `load'", "/opt/gems/ruby/3.3.0/bin/puma:25:in `<main>'"]

This doesn't trigger the grep filter for 'puma/request' checked by GoodJob.configuration.in_webserver? and thus a capsule is still started for each puma worker when GoodJob.restart is called.

@bensheldon
Copy link
Owner

Thanks for opening the issue! There should probably be a line for puma/launcher or puma/clusterinGoodJob.configuration.in_webserver?` too. Would you be able to make a PR for that?

@amanfredi
Copy link
Author

Yes, I can put together a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Inbox
Development

No branches or pull requests

2 participants