Red Hat Bugzilla – Bug 1472325
[RFE] clean up STAGE_BOOT priorities/schedule
Last modified: 2017-12-20 06:02:04 EST
Description of problem:
I am opening this bug because current , which is for bug 1169099, fails, because I added there an event SECRETS_FILTERED_FROM_SETUP_ATTRS_MODULES to run before CORE_LOG_INIT but without setting priority.
A later patch  adds several new events to run before SECRETS_FILTERED_FROM_SETUP_ATTRS_MODULES.
I'd rather not set priorities to all of these, and instead give names and set before=/after= as needed, which is much cleaner and more transparent.
Priorities were added to otopi as a means to affect order of running the events quite early, and later before/after were added . Some of the then-existing code that used priorities, was not changed to use before/after, and today it's a bit hard to understand the exact reasons for the priorities - as opposed to before/after, which say specifically that some event should run before or after some specific events.
I am opening this bug mainly to document what I currently think/understand about this.
So the following is an analysis of current state, partially a guesswork, with comments about what can/should be done. I am also documenting here the relevant code from engine's packaging/setup, from host-deploy (which is simpler - only two events), ovirt-hosted-engine-setup (only 1 event).
is in otopi:src/plugins/otopi/core/log.py
Many _BOOT events in the engine and all in host-deploy and hosted-engine-setup that have before=CORE_LOG_INIT also need to have a specific priority.
- Drop priority from this and all related events
- Check which events in _BOOT write to the log and either move them to _INIT or make them after=CORE_LOG_INIT
is in otopi:src/plugins/otopi/core/config.py
is in stage_INIT, not _BOOT
sets a default CONFIG_FILE_NAME if not set yet
sas PRIORITY_HIGH - 10
CONFIG_FILE_NAME is actually set by both engine and host-deploy at stage _BOOT, so no need to have priority for either for it or engine/host-deploy, as _boot runs before _init.
- Drop priority from it and events setting CONFIG_FILE_NAME in engine/host-deploy
dnf has: PRIORITY_LOW
yum has: PRIORITY_LOW+1
It's set so that dnf runs before yum, because if a system has both, we want dnf to be used and not yum.
- Drop priority
- Add a name to yum
- Make dnf run before=yum
is in otopi:src/plugins/otopi/dialog/misc.py
sets default dialog to be human
machine and human plugins _BOOT events run at PRIORITY_MEDIUM
- Remove priorities
- Give misc.py a name
- Run the others after it
Logs the sequence and the initial environment
Logs random system info
I guess both are LOW so that they run after the log file is created.
- Remove priority
- Run after=CORE_LOG_INIT
Could you please provide verification steps if there are any? Thank you.
(In reply to Jiri Belka from comment #1)
> Could you please provide verification steps if there are any? Thank you.
Comment 0 is very detailed, and IIRC the patches actually do exactly what I wrote there. Most of the stuff there would probably have been noticed already by basic sanity tests done elsewhere - e.g. log file in /tmp and not in /var, stuff like that. Feel free to review it and decide to do a few specific tests if you think they make sense. Other than that, can't think of anything specific, setting CodeChange.
deploying hosts works ok
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.
Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.
If the solution does not work for you, please open a new bug report.