fix: fast-kill qlds restarts#139
Conversation
There was a problem hiding this comment.
PR Review: fast-kill QLDS restarts (v1.13.10)
Strengths
- Well-reasoned design: The comment block in
qlds@.service.j2:20-26clearly explains the three-way constraint: skip the 10s SIGTERM wait (process ignores it), keep restarts fast, and preserve failure detection for OOM/external kills. This is non-obvious systemd behavior explained well in-place. - Correct decision to omit
SuccessExitStatus=SIGKILL: SettingKillSignal=SIGKILLwithoutSuccessExitStatus=SIGKILLis precisely correct.systemctl stop/restartare intentional and systemd won't applyRestart=on-failurefor them regardless of exit status. External kill-9/OOM will still be treated as failures and trigger auto-restart — which is the desired behavior. - Regression guards in the test (
test_qlds_service_template.py:28-31): Thenot inassertions explicitly guard against future introduction ofSuccessExitStatus=SIGKILLor a rollback to the old 10s timeout. That's a good use of negative assertions for a subtle behavioral invariant. - Minimal blast radius: Change touches only the service template, its test, and version bookkeeping. No application code changed.
Issues
Critical (Must Fix)
None.
Important (Should Fix)
None.
Minor (Nice to Have)
-
TimeoutStopSec=2rationale could be noted:ansible/templates/qlds@.service.j2:26— the 2s value is kept to give systemd's cgroup sweep time to collect any child processes after the main process is SIGKILL'd. A brief inline note (or expanding the existing comment) would help future maintainers understand why0or1wasn't chosen. Not a correctness issue. -
Trailing whitespace removed silently: The old
TimeoutStopSec=10had a trailing space that's now gone. Not a problem, just worth noting it's a silent clean-up bundled in.
Assessment
Ready to merge? Yes
Reasoning: The change correctly exploits the systemd contract (Restart=on-failure doesn't apply to deliberate stops) to make config-apply restarts ~8s faster without altering OOM/external-kill behavior. The test covers all key assertions and the comment explains the non-obvious invariant being preserved.
Summary
Test Plan