systemd sd_notify is sent before initialization is complete
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.service |
New
|
Undecided
|
Unassigned |
Bug Description
I implemented a systemd Before= constraint between ironic conductor and nova compute (for horrible reasons which aren't important here). I noticed that although ironic conductor always started first, nova compute started almost immediately after, and long before ironic conductor initialization was complete.
The manpage for systemd.service says:
Behavior of notify is similar to simple; however, it is expected that the daemon sends a notification message via sd_notify(3) or an equivalent call when it has finished starting up. systemd will proceed with starting follow-up units after this notification message has been sent.
However, both ServiceLauncher and ProcessLauncher call systemd.
The behaviour we want is:
ServiceLauncher: notify is sent from the service thread after service.start()
ProcessLauncher: notify is sent from the main process after at least 1 (or perhaps all; discuss) worker process has run service.start()
So, for e.g. move systemd.
The systemd notifications are useless as implemented, and the behaviour of Type=notify is identical to the behaviour of Type=simple.