ruby-shoryuken / shoryuken

A super efficient Amazon SQS thread based message processor for Ruby. This project is in MAINTENANCE MODE. Reach me out on Slack link on the description if you want to become a new maintainer.
Other
2.05k stars 280 forks source link

Process terminated when started from Procfile #748

Closed januszm closed 11 months ago

januszm commented 1 year ago

I have an application that uses Shoryuken on AWS Elastic Beanstalk, I even added instructions here on how to configure it. It worked OK until about early 2023 but I see it stopped for some reason. The instructions from the wiki are a bit out of date, the process does not start. I've now tried changing this to run via Procfile, which seems more appropriate at the moment.

web: bundle exec puma -C /opt/elasticbeanstalk/config/private/pumaconf.rb --pidfile /var/app/current/tmp/pids/server.pid
worker: bundle exec shoryuken -R -P /var/app/current/tmp/pids/shoryuken.pid -L /var/app/current/log/shoryuken.log -d

But the process is constantly restarted, receives the TERM signal and then starts over and over again. I'm wondering if there's something wrong with my config or the gem just doesn't work with Procfile?

15572 TID-40g INFO: Starting
15572 TID-40g INFO: Received TERM, will shutdown
15572 TID-40g INFO: Shutting down
15650 TID-40g INFO: Starting
15650 TID-40g INFO: Received TERM, will shutdown
15650 TID-40g INFO: Shutting down

Currently the only way to run it side by side with puma webserver on Elastic Beanstalk is by SSH and manually executing the script I described on Wiki, it doesn't work as an Elastic Beanstalk hook, only works when started from interactive shell.

januszm commented 1 year ago

Solved! it's the -d option, if you want to run shoryuken via Procfile, -d cannot be used, also -r is problematic if used with relative path, e.g. -r app/jobs

bundler: failed to load command: shoryuken (/opt/elasticbeanstalk/.rbenv/versions/3.0.6/bin/shoryuken)

gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require':
cannot load such file -- app/jobs/my_job.rb (LoadError)

Maybe -r requires absolute paths, but anyway, I think it's redundant when I use Rails with -R as the whole app will be preloaded anyway

github-actions[bot] commented 11 months ago

This issue is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon.

github-actions[bot] commented 11 months ago

This issue was closed because it hasn't seen activity for a while.