Skip to content

fix: fast-kill qlds restarts#139

Merged
dngrtech merged 1 commit into
mainfrom
fix/qlds-fast-restart-kill
Jul 8, 2026
Merged

fix: fast-kill qlds restarts#139
dngrtech merged 1 commit into
mainfrom
fix/qlds-fast-restart-kill

Conversation

@dngrtech

@dngrtech dngrtech commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • switch QLDS systemd stops/restarts to send SIGKILL immediately instead of waiting on SIGTERM timeout
  • keep unexpected external SIGKILL/OOM classified as failure by not marking SIGKILL as a successful exit
  • bump release/version metadata to 1.13.10

Test Plan

  • pytest tests/test_qlds_service_template.py tests/test_systemd_template_render.py tests/test_service_enablement_playbooks.py -q
  • Render qlds@.service.j2 and run systemd-analyze verify; no parse errors for new QLDS directives, only expected local missing ExecStart path
  • Full pytest currently has an unrelated pre-existing failure: tests/test_script_routes.py::TestValidateScript::test_validate_invalid_python fails when run alone

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: fast-kill QLDS restarts (v1.13.10)

Strengths

  • Well-reasoned design: The comment block in qlds@.service.j2:20-26 clearly 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: Setting KillSignal=SIGKILL without SuccessExitStatus=SIGKILL is precisely correct. systemctl stop/restart are intentional and systemd won't apply Restart=on-failure for 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): The not in assertions explicitly guard against future introduction of SuccessExitStatus=SIGKILL or 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=2 rationale 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 why 0 or 1 wasn't chosen. Not a correctness issue.

  • Trailing whitespace removed silently: The old TimeoutStopSec=10 had 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.

@dngrtech dngrtech merged commit a9a61ee into main Jul 8, 2026
1 check passed
@dngrtech dngrtech deleted the fix/qlds-fast-restart-kill branch July 8, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant