Skip to content

add bin/jobs check to validate config before starting#745

Open
alexanderadam wants to merge 1 commit into
rails:mainfrom
alexanderadam:feature/add_config_check_command
Open

add bin/jobs check to validate config before starting#745
alexanderadam wants to merge 1 commit into
rails:mainfrom
alexanderadam:feature/add_config_check_command

Conversation

@alexanderadam
Copy link
Copy Markdown
Contributor

Hello,

this is yet another approach for the config issue (#722).
If you have a typo in recurring.yml (i.e. '0 * * * ^' instead of '0 * * * *') the supervisor boots, reads the bad config, prints the error to a stdout nobody's listening on, and then exits.
systemctl start succeeds.
There are no workers running and no error in the journal.
You don't find out until something that should have been processed wasn't.

This PR adds bin/jobs check (and solid_queue:check for people who'd rather rake it 'til they make it) that runs the existing Configuration validations for the current Rails env and exits non-zero if anything is bananas.

The one wrinkle: the thread-pool validator pokes at SolidQueue::Record.connection_pool, which raises on hosts that don't have DB credentials (CI etc). Added a skip_db_checks option so the check path can swallow that one specific error and validate everything else.
So supervisor startup keeps the strict behaviour.

Lets you catch broken recurring.yml etc before the supervisor
boots and silently exits. Works as `bin/jobs check` or the
`solid_queue:check` rake task.
Skips the DB-pool check when DB creds aren't around (for isntance on
CI).

See rails#722 for more info

PS: 🐶 <- this is mochi!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant