bensheldon / good_job

Multithreaded, Postgres-based, Active Job backend for Ruby on Rails.
https://goodjob-demo.herokuapp.com/
MIT License
2.53k stars 190 forks source link

fix: require rack/handler for rack >= 3.1.x #1383

Closed shouichi closed 3 weeks ago

shouichi commented 3 weeks ago

From rack >= 3.1.x, Rack::Handler is not auto-loaded anymore. Though we should migrate to Rackup::Handler, we can't in the short term. This is because of the support of rails <= 7.0 that doesn't depend on rackup.

Earlopain commented 3 weeks ago

How about something like rails does it? https://github.com/rails/rails/blob/de4d8744744acab2dd9db0683ccf784ea45810b2/railties/lib/rails/rackup/server.rb

bensheldon commented 3 weeks ago

@shouichi @Earlopain Thank you both! I updated it based on the Rails PR, which I think will produce the Rack deprecation warning too during the fallback.

I'm reluctant to add rackup to the gemspec because I don't consider the healtcheck "core" functionality, so at a certain point we'll likely need to catch the loaderror and gracefully handle it with a message like "You'll need to add rackup to your gemfile."

Also, while trying to get Sorbet definition in place, I learned that the rackup 1.0 release is busted: https://github.com/rack/rackup/issues/13#issuecomment-2186788166

bensheldon commented 3 weeks ago

Released: https://github.com/bensheldon/good_job/releases/tag/v3.29.5

shouichi commented 3 weeks ago

@Earlopain Thank you for the feedback!

@bensheldon Thank you for the quick release! I confirmed the release works as intended in rails 7.1.