New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scope: do not disable timer event source when state is SCOPE_RUNNING #27144
Conversation
I don't think the one CI failure is related. |
Could you please add a test for this, maybe in |
lgtm |
Yeah I can add a test. I wonder if it makes sense to just create a new |
It's better to avoid proliferation of tests, it's cheaper to add to existing ones, especially when they are related - that one already uses RuntimeMaxSec |
In scope_set_state(), the timer event source may be disabled depending on the state. Currently, it will be disabled when the state is SCOPE_RUNNING. This has the effect of new RuntimeMaxSec values being ignored on coldplug. Note that this issue is not currently present when scopes are started because when scope_start() is called, scope_arm_timer() is called after scope_set_state().
3676ff4
to
551321c
Compare
Make sure the RuntimeMaxSec is applied correctly to service and scope units when they are started, and also on coldplug.
551321c
to
af46883
Compare
In scope_set_state(), the timer event source may be disabled depending on the state. Currently, it will be disabled when the state is SCOPE_RUNNING. This has the effect of new RuntimeMaxSec values being ignored on coldplug.
Note that this issue is not currently present when scopes are started because when scope_start() is called, scope_arm_timer() is called after scope_set_state().
This fixes an issue where new
RuntimeMaxSec
values are not applied to running scopes when the manager is reloaded. This can be demonstrated by starting a transient scope, then writing an override configuration with e.g.RuntimeMaxSec=10s
, and then callingsystemctl daemon-reload
. Currently, the scope will keep running with the old value (probably infinity).