You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Type=notify-reload units that don't send READY=1 after RELOADING=1 stay stuck reloading instead of timing out after TimeoutStartSec= seconds #37515
Note that the start timeout is also applied to service reloads, regardless if implemented through ExecReload= or via the reload logic enabled via Type=notify-reload. If the reload does not complete within the configured time, the reload will be considered failed and the service will continue running with the old configuration. This will not affect the running service, but will be logged and will cause e.g. systemctl reload to fail.
Unexpected behaviour you saw
systemctl reload never returns and systemd keeps logging Reload operation timed out. Killing reload process. every TimeoutStartSec= seconds
changed the title [-]Type=notify-reload units that don't send READY=1 stay stuck reloading instead of timing out after `TimeoutStartSec=` seconds[/-][+]Type=notify-reload units that don't send `READY=1` after `RELOADING=1` stay stuck reloading instead of timing out after `TimeoutStartSec=` seconds[/+]on May 19, 2025
Maybe @bluca was right after all (#33995 (comment)), that our state engine tries to handle Type=notify-reload + ExecReload= but currently in a vastly borked way. I'll do a refactor...
Yeah, I'll just comment down what came to my mind now:
service_enter_running() called from service_dispatch_timer() in SERVICE_RELOAD_NOTIFY state catches s->notify_state == NOTIFY_RELOADING again and enters an infinite loop -> service_enter_reload_by_notify().
We have a variety of possible modes of operation and it gets hairy without explicit ordering:
Type=notify-reload protocol
Main process issuing RELOADING=1 and READY=1 spontaneously
ExecReload=
1 + 2/3: this one is very problematic as it is now, as we signal the main process and directly transition to SERVICE_RELOAD with ExecReload= for 3, or enter SERVICE_RELOAD_NOTIFY directly for 2. In either case, service_enter_running() can't properly distinguish a deferred NOTIFY_RELOADING from timing out notify-reload protocol.
To make the semantics clear, ExecReload= should probably be executed first and the ReloadSignal= is sent only when that finishes. Then, introduce ExecReloadPost= a la ExecStopPost= to carry out post-reload businesses.
This of course is going to become a breaking change, but nevertheless we should clean things up thoroughly and as discussed (thankfully) not so many people are using a mix of Type=notify-reload for now.
Please wait until after #33995 as it's been almost a year of work by this point
Ok that's merged now, so all yours!
As mentioned many times there I really think mixing these workflows as a supported feature would be a mistake, as it makes everything so much more complicated, and literally nobody uses it. As you have found out, notify+execreload really do not work together. But if you want to spend your time on it, I certainly won't stop you. Just don't break my stuff ;-)
Activity
[-]Type=notify-reload units that don't send READY=1 stay stuck reloading instead of timing out after `TimeoutStartSec=` seconds[/-][+]Type=notify-reload units that don't send `READY=1` after `RELOADING=1` stay stuck reloading instead of timing out after `TimeoutStartSec=` seconds[/+]YHNdnzj commentedon May 19, 2025
Maybe @bluca was right after all (#33995 (comment)), that our state engine tries to handle Type=notify-reload + ExecReload= but currently in a vastly borked way. I'll do a refactor...
bluca commentedon May 19, 2025
Please wait until after #33995 as it's been almost a year of work by this point
YHNdnzj commentedon May 19, 2025
Yeah, I'll just comment down what came to my mind now:
service_enter_running()called fromservice_dispatch_timer()inSERVICE_RELOAD_NOTIFYstate catchess->notify_state == NOTIFY_RELOADINGagain and enters an infinite loop ->service_enter_reload_by_notify().We have a variety of possible modes of operation and it gets hairy without explicit ordering:
RELOADING=1andREADY=1spontaneouslyExecReload=SERVICE_RELOADwith ExecReload= for 3, or enter SERVICE_RELOAD_NOTIFY directly for 2. In either case,service_enter_running()can't properly distinguish a deferredNOTIFY_RELOADINGfrom timing out notify-reload protocol.To make the semantics clear,
ExecReload=should probably be executed first and theReloadSignal=is sent only when that finishes. Then, introduceExecReloadPost=a laExecStopPost=to carry out post-reload businesses.YHNdnzj commentedon May 19, 2025
This of course is going to become a breaking change, but nevertheless we should clean things up thoroughly and as discussed (thankfully) not so many people are using a mix of Type=notify-reload for now.
YHNdnzj commentedon May 19, 2025
And if we get RELOADING=1 during ExecReload= execution already, don't try to signal the main process anymore.
bluca commentedon May 20, 2025
Ok that's merged now, so all yours!
As mentioned many times there I really think mixing these workflows as a supported feature would be a mistake, as it makes everything so much more complicated, and literally nobody uses it. As you have found out, notify+execreload really do not work together. But if you want to spend your time on it, I certainly won't stop you. Just don't break my stuff ;-)
core/service: reset all reload-related states once a cycle completes
12 remaining items
TEST-80-NOTIFYACCESS: add test case for systemd#37515
core/service: reset all reload-related states once a cycle completes
core/service: rework ExecReload= + Type=notify-reload interaction, ad…
TEST-80-NOTIFYACCESS: add test case for systemd#37515
core/service: reset all reload-related states once a cycle completes
core/service: rework ExecReload= + Type=notify-reload interaction, ad…
TEST-80-NOTIFYACCESS: add test case for systemd#37515
core/service: reset all reload-related states once a cycle completes
core/service: rework ExecReload= + Type=notify-reload interaction, ad…
TEST-80-NOTIFYACCESS: add test case for systemd#37515
core/service: reload fixlets (#39376)