fix(apache.service.running): prevent recursive requisite #391
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.
PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[build]
Changes related to the build system[chore]
Changes to the build process or auxiliary tools and libraries such as documentation generation[ci]
Changes to the continuous integration configuration[feat]
A new feature[fix]
A bug fix[perf]
A code change that improves performance[refactor]
A code change that neither fixes a bug nor adds a feature[revert]
A change used to revert a previous commit[style]
Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)Secondary type
[docs]
Documentation changes[test]
Adding missing or correcting existing testsDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
This fixes the same issue as #388, but slightly more completely.
Describe the changes you're proposing
The fixes circular requisite errors when using the formula. Most of the change isn't mine (see the commit authors), but I added some tweaks, hence the new PR.
In terms of how the change works, mostly copying from my comment on #388
apache/config/file.sls are all just
s/require_in/watch_in/`. AIUI the watch requisite implies the require requisite, so these are required either way, this just means that we restart Apache if they change.file.directory
states. I think if Apache previously crashed,service.running
would rerun anyway, and it's unlikely that Apache would run but incorrectly without these directories, so I don't see whywatch_in
is needed. OTOH, it's probably harmless.require_in
is getting combined with thewatch_in
). This seems like an improvement, though it's hard to see how it would improve a circular dep.watch_in
for the main config file. This seems like it would be pretty important to getting appropriate config-reloading behavior.)apache-service-running*
states lose theirwatch
(and usually require, which AIUI is redundant) onsls: {{ sls_config_file }}
, which AFAICT is just the wholeapache.config.file
from earlier in the PR. Effectively, in combination with the earlier changes, I think this is replacing a broad dependency from the running states on the whole config file sls (inrunning.sls
) with narrow dependencies from the running states to each of the config file states (infile.sls
). My guess is thatrequire: sls: whatever
requires everything in that SLS, including the includes, and weinclude
{{ sls_service_running}}
, which would make a loop.-reload
and-running
lose theirwatch
/require
entirely (there's no consistentwatch_in
for them), but they'reafter
theservice: apache-service-running
. I can't find a definition ofafter
, but my guess is this functionally means we needapache-service-running
's prereqs, which is good enough. (Also these shouldn't run all that much.)apache/config/modules/install.sls
to use a finer-grained requisite there (based on danny-smit's patch)I also reduce the amount of logging dumped to salt when Apache restarts -- the old parameters could really clutter the output, which was very apparent when circular deps meant it kept failing to restart.
Pillar / config required to test the proposed changes
Debug log showing how the proposed changes work
Documentation checklist
README
(e.g.Available states
).pillar.example
.Testing checklist
state_top
).Additional context