You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're running SolidQueue as a Puma plugin on a Rails 8 app, as our job processing load is currently quite small.
We recently had an incident where the server running Puma temporarily lost the connection to Postgres. This caused SolidQueue to crash with this message:
PQconsumeInput() FATAL: terminating connection due to administrator command (PG::
ConnectionBad)
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
and this in turn took down Puma:
Detected Solid Queue has gone away, stopping Puma...
- Gracefully stopping, waiting for requests to finish
I was able to reproduce this locally by shutting down Postgres after starting Rails.
When running Rails without the SolidQueue Puma plugin, if the database goes away, Rails throws an error when it tries to do something with the database, but Puma stays up and the connections recover when the database comes back online.
If I run SolidQueue separately, via bin/jobs, it also crashes if the database goes away.
Obviously SolidQueue can't be expected to do much without a database, but would it be reasonable for it to behave as Rails does when the db goes offline, i.e. pause its activity and reconnect when the db is available again?
Thanks for all your work on this - SolidQueue has been a fantastic addition to Rails!
The text was updated successfully, but these errors were encountered:
Oh, interesting. This happens for the supervisor only, if any of the supervised processes crashes, the supervisor makes sure a new one is started 🤔 I think the supervisor would need some kind of recovery mechanism if the DB fails, but it could also crash for other reasons. I think it makes sense to do this, but I won't have time in the next couple of months at least, so if someone wants to submit a PR doing this, I'll be happy to review.
We're running SolidQueue as a Puma plugin on a Rails 8 app, as our job processing load is currently quite small.
We recently had an incident where the server running Puma temporarily lost the connection to Postgres. This caused SolidQueue to crash with this message:
and this in turn took down Puma:
I was able to reproduce this locally by shutting down Postgres after starting Rails.
When running Rails without the SolidQueue Puma plugin, if the database goes away, Rails throws an error when it tries to do something with the database, but Puma stays up and the connections recover when the database comes back online.
If I run SolidQueue separately, via
bin/jobs
, it also crashes if the database goes away.Obviously SolidQueue can't be expected to do much without a database, but would it be reasonable for it to behave as Rails does when the db goes offline, i.e. pause its activity and reconnect when the db is available again?
Thanks for all your work on this - SolidQueue has been a fantastic addition to Rails!
The text was updated successfully, but these errors were encountered: