Repository navigation
fix(runtime): disable debug mode in the Flask service - #3917
Closed
8079-debug wants to merge 1 commit into
Closed
8079-debug wants to merge 1 commit into
8079-debug wants to merge 1 commit into
Conversation
Keep the directly launched service's debugger and reloader disabled, with regression coverage for startup settings and normal HTTP behavior.
4 of 9 tasks
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
debug=Falsein the direct-launch entrypoint ofruntime/python/websocket/funASR-Service.py, which retains its existing host and port. This prevents the launcher from unconditionally enabling Flask's development debugger and reloader.Flask.run, includingFLASK_DEBUGunset,0, and1. Also check existing missing-upload responses, a valid similarity request, and generic HTTP 500 handling.Type of change
Validation
Windows x64, Python 3.13.3, Flask 3.0.0. No model downloads or GPU inference.
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -q tests/test_flask_service_debug.py: 4 failed, 1 passed, reproducing enabled debug mode and exception propagation.PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -q tests/test_flask_service_debug.py tests/test_websocket_server_asr_model.py tests/test_websocket_server_hotwords.py tests/test_websocket_file_finalization.py: 41 passed.python -m compileall -q funasr examples tests runtime/python/websocket/funASR-Service.py: passed.Model/dependency boundaries are stubbed; Flask, request dispatch, JSON responses and its startup option handling are real. Only
werkzeug.serving.run_simpleis intercepted at the socket-listening boundary, so these are local startup/WSGI regressions, not a deployed-server or ASR-quality test. The optional test dependencies are Flask, NumPy, SciPy and pytest.User impact
Directly starting this example no longer enables its development debugger or automatic reloader. Existing binding, routes and successful response shapes are preserved. This does not make the development server a production deployment recommendation.
Notes for reviewers
This is a deliberately narrow, independently tested subset of the previously closed, unmerged #3877. It does not include that PR's upload/JSON/cleanup changes or claim to resolve the upload-cleanup review findings. Those require a separate fix and their own route/filesystem regressions.