-
Notifications
You must be signed in to change notification settings - Fork 289
Open
Labels
Description
Summary
Allow Shoryuken to gracefully shut down when workers encounter unrecoverable errors, enabling container orchestrators (ECS, Kubernetes) to restart the service.
Use Case
Common scenario with AWS RDS credential rotation:
- Database password rotates every 7 days via AWS Secrets Manager
- Running ECS tasks have stale credentials in environment
ActiveRecord::NoDatabaseErroris raised and caught by retry middleware- Messages keep getting retried unnecessarily
- Desired behavior: Shoryuken shuts down, ECS restarts container with fresh env
Proposed Solution
- Add configuration for "fatal" or "unrecoverable" error classes
- When these errors occur, trigger graceful shutdown instead of retry
- Similar to how Sidekiq handles
Sidekiq::Shutdown
Shoryuken.configure_server do |config|
config.fatal_errors = [
ActiveRecord::NoDatabaseError,
Aws::SQS::Errors::InvalidClientTokenId
]
endOriginal Issue
This was originally requested in #773 and closed by the stale bot without resolution.