Use candlepin.service in foreman startup ordering#413
Merged
evgeni merged 1 commit intotheforeman:masterfrom Mar 20, 2026
Merged
Use candlepin.service in foreman startup ordering#413evgeni merged 1 commit intotheforeman:masterfrom
evgeni merged 1 commit intotheforeman:masterfrom
Conversation
evgeni
reviewed
Mar 19, 2026
src/roles/foreman/tasks/main.yaml
Outdated
Comment on lines
+129
to
+130
| Wants=candlepin.service | ||
| After=foreman.target candlepin.service |
Member
There was a problem hiding this comment.
This will break in setups that don't have candlepin.
Won't this work too?
Suggested change
| Wants=candlepin.service | |
| After=foreman.target candlepin.service | |
| Wants=redis.service postgresql.service candlepin.service | |
| After=foreman.target redis.service postgresql.service candlepin.service |
Contributor
Author
There was a problem hiding this comment.
I didn't know that we could skip candlepin... Yes, that would work too.
Member
There was a problem hiding this comment.
We can't today in foremanctl, but long term we will offer non-Katello deploys which don't need Candlepin.
Member
|
Can you include this in #409 to see if things actually pass then? |
Contributor
Author
|
Added. |
Foreman depends on Candlepin being fully initialised before it can
serve requests reliably. Without this ordering, foreman.service starts
simultaneously with candlepin.service, competing for CPU and disk I/O
during the JVM startup. This pushes Rails loading time close to the
default TimeoutStartSec (90s) and causes intermittent failures on
restart, particularly when the system is under load.
Because candlepin.service already declares:
After=redis.service postgresql.service
the transitive ordering becomes:
postgresql --+
+--> candlepin --> foreman
redis -------+
redis.service and postgresql.service are kept as explicit dependencies
to preserve correct ordering in future non-Katello deployments that
may not include candlepin.service.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4026154 to
3874dee
Compare
Contributor
Author
|
Do you want me to drop this in favor of #409? |
evgeni
approved these changes
Mar 20, 2026
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.
foreman.servicecurrently declaresAfter=redis.service postgresql.service, starting it at the same time ascandlepin.service. Under load — particularly onsystemctl restart foreman.target— all containers race for CPU and disk I/O simultaneously, pushing Rails gem loading past the defaultTimeoutStartSec(90 s) and causing intermittent failures.The fix replaces the explicit
redisandpostgresqldependencies withcandlepin, sincecandlepin.servicealready declares:After=redis.service postgresql.serviceThis gives the transitive ordering:
Foreman now starts after Candlepin has finished its JVM initialisation. By that point the I/O storm from parallel container startups has settled and Rails loads in ~35 s instead of 75–90 s, comfortably within the timeout regardless of system load.
Testing:
Verified with 7 consecutive CI runs across all certificate modes, external DB, fapolicyd, stream9, stream10, and upgrade scenarios.