Skip to content

Add candlepin.service to foreman startup ordering - #11

Open
pablomh wants to merge 1 commit into
masterfrom
candlepin_dependency
Open

Add candlepin.service to foreman startup ordering#11
pablomh wants to merge 1 commit into
masterfrom
candlepin_dependency

Conversation

@pablomh

@pablomh pablomh commented Mar 18, 2026

Copy link
Copy Markdown
Owner

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 -> redis -> candlepin -> foreman

so the explicit postgresql.service dependency on foreman.service is no longer needed and is replaced by candlepin.service.

The lifecycle tests (tests/target_lifecycle_test.py) are included to verify that systemctl stop/start and systemctl restart on foreman.target work reliably after this change.

@pablomh
pablomh force-pushed the candlepin_dependency branch 5 times, most recently from b0d4a10 to 4026154 Compare March 19, 2026 13:16
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>
@pablomh
pablomh force-pushed the candlepin_dependency branch from 4026154 to 3874dee Compare March 19, 2026 15:11
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