fix: production hardening — critical issues for 24/7 deployment - #18
Merged
Conversation
- MJPEG stream handles GeneratorExit on client disconnect - Use waitress production server (fallback to Flask dev) - Audio health check in main loop: detect dead thread, notify, disable - Audio callback race condition: all calibration state under lock - CPU spin on frame failures: add sleep before continue - Initialize snap_path to prevent potential UnboundLocalError - Only call cv2.waitKey when preview window is active - Handle non-integer FPS in /settings gracefully - Log audio stream status warnings (overflow/underflow) - Bump pyproject.toml version to 2.0.0 - Add 15 new tests covering all fixes (189 total passing)
This was referenced Feb 7, 2026
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.
Summary
Fixes 5 critical and 3 high-severity issues identified during production readiness review:
Critical fixes:
GeneratorExitto prevent leaked threads on client disconnecttime.sleep(0.1)beforecontinueHigh fixes:
snap_pathinitialized toNoneto prevent potentialUnboundLocalErrorcv2.waitKeyonly called when preview window is active (fixes headless mode)/settingsendpoint handles non-integer FPS input gracefully (no more 500 errors)Other:
pyproject.tomlversion to 2.0.0Test plan