add bin/jobs check to validate config before starting#745
Open
alexanderadam wants to merge 1 commit into
Open
Conversation
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!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 startsucceeds.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(andsolid_queue:checkfor people who'd ratherrakeit 'til they make it) that runs the existingConfigurationvalidations 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 askip_db_checksoption so thecheckpath can swallow that one specific error and validate everything else.So supervisor startup keeps the strict behaviour.