Repository navigation
fix(deploy): restart the TTS worker explicitly, not via notify handler (#12886) - #13144
Merged
Merged
Conversation
#12886) The file reached the host and the route was still 404, because the service was never restarted — running since Jul 27, serving stale code from memory. Handler-driven restart fails here twice over, both observed live: 1. handlers flush at END of play, and PLAY 2 dies at the browser tasks (#12912), so the queued 'restart tts-worker' was discarded; 2. #13143's flush_handlers did not help, because by then the file was already current — the template reported ok, never notified, and there was nothing queued to flush. A host with the file but no restart stays stale forever. Restart explicitly instead, matching how every other component in this play is handled (NPU, Browser, backend all use systemd state=restarted with become and failed_when: false). Unconditional, so it cannot be swallowed and does not depend on a changed-file signal. Tests: the flush assertion is replaced by one requiring an explicit restart task after the include; 7 pass; playbook passes ansible --syntax-check.
Contributor
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
Security review flagged fail-open state drift: the restart carried failed_when: false, copied from the NPU/Browser convention above it. That is wrong for this task specifically. The entire issue is a worker serving stale code while the update reported success. Swallowing a restart failure recreates it exactly — file lands, process never reloads, play goes green, nothing says otherwise. The neighbouring restarts swallow errors so one optional worker cannot fail the whole update. That trade-off does not apply to the task whose only purpose is proving the worker reloaded. Tests: 1 new asserting the restart does not fail open; 8 pass; syntax-check clean.
This was referenced Aug 9, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thinking Path
Supersedes the approach in #13143, which did not work. Verified on the host rather than from the recap.
State after #13143 merged and an update ran: the file is correct on disk, the route is still 404.
Four days old. The worker had the new file and was serving old code from memory.
Handler-driven restart fails here for two compounding reasons:
restart tts-workerwas discarded — that was the fix(deploy): flush the TTS restart immediately so a later failure cannot swallow it (#12886) #13143 diagnosis, andmeta: flush_handlerswas the right fix for that.flush_handlersstill did nothing, because by then the file was already current from the prior run. The template task reportedok, so it never notified, so nothing was queued to flush. A host that received the file but missed the restart is stuck permanently — there is no longer any change to trigger it.(2) is the part I got wrong in #13143: I fixed when handlers run without asking whether a handler would fire at all.
So restart explicitly, matching the convention every other component in this play already follows — NPU, Browser and backend all use
systemd: state=restartedwithbecome: trueandfailed_when: false. Unconditional, so it cannot be swallowed by a later failure and does not depend on a changed-file signal.What Changed
playbooks/update-all-nodes.yml— themeta: flush_handlerstask from #13143 is replaced by an explicit[PLAY 2] TTS | Restart servicetask, mirroring the NPU restart exactly, with a comment recording both failure modes.tests/test_updater_refreshes_tts_worker_12886.py— the flush assertion is replaced by one requiring an explicitautobot-tts-workerrestart task ordered after the include.Verification
Still unproven on the host, which is the only acceptance that counts:
/tts/synthesize/streamserved,ExecMainStartTimestamprecent, and the #12959 probe'stts-worker (#12886)entry clearing. I will run the update after merge and report the outcome either way — this is the third attempt at this delivery, and I would rather report another miss than claim success from a green recap.Model Used
Claude Opus 5 (
claude-opus-5)Follow-up
Closes #12886 once the route is confirmed served.
Refs #12912 (browser blocker — its failure is what exposed the handler problem), #12959, #13132.