Skip to content

Fix Piper subprocess engine robustness#7

Open
phyceClaw wants to merge 1 commit into
phyce:mainfrom
phyceClaw:fix/piper-robustness
Open

Fix Piper subprocess engine robustness#7
phyceClaw wants to merge 1 commit into
phyce:mainfrom
phyceClaw:fix/piper-robustness

Conversation

@phyceClaw

Copy link
Copy Markdown

Summary

In app/tts/engine/piper/piper.go:

  • Swallowed Start error: Generate discarded the result of Start() and proceeded even when the model failed to start. Now returns the error.
  • Data race on models map: Start/Stop/Generate/GetProcessID accessed the map with no synchronization. Guarded with a mutex.
  • Goroutine hang: the stderr-scanning goroutine signaled completion only on a " sec)" line via an unbuffered channel, and Generate blocked on it with no timeout — a dead/silent subprocess hung forever. Now bounded (buffered signal + timeout/exit).
  • Removed leftover debug logs.

Testing

CGO_ENABLED=1 go build ./app/... passes; go vet clean.

🤖 Generated with Claude Code

- Return on Start() failure in Generate instead of proceeding against
  a model that failed to start
- Guard the Piper.models map with a mutex (was a data race / nil-map
  panic risk across Start/Stop/Generate/GetProcessID)
- Bound the stderr-scanning goroutine so a dead or silent subprocess
  can no longer hang Generate forever (buffered signal + timeout/exit)
- Remove leftover debug logs

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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