fix: preserve startup errors and exit status - #304
Open
LauraGPT wants to merge 1 commit into
Open
Conversation
Signed-off-by: LauraGPT <18321252+LauraGPT@users.noreply.github.com>
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
Root cause
The top-level entrypoint currently calls
os._exit(0)from an unconditionalfinallyblock. Any exception raised while loading handlers is therefore discarded before Python can report it, and Docker sees a successful exit even though the service never started.This matches the symptom in #296: handler registration succeeds, loading stops partway through initialization, no traceback is shown, and the container exits as status 0. The reported log only proves that SenseVoice was registered; its model load had not started yet. The next handler after the last successful load message is Silero VAD.
This change keeps the explicit
os._exitbehavior but logs unexpected exceptions and propagates exit status 1, so the underlying handler error becomes actionable.Verification
python3 -m pytest -q tests/test_demo_entrypoint.py(1 passed)python3 -m py_compile src/demo.py tests/test_demo_entrypoint.pygit diff --checkRelated to #296.