Properly handle the Azure Recognizer shutdown after audio ended. - #95
Merged
Conversation
…ure recognizer after audio ended, and fix the problem in the azure-speech-sdk-rs
pragmatrix
marked this pull request as ready for review
August 5, 2026 12:34
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an (ignored) Azure integration regression test to ensure Azure transcription sessions stop cleanly after audio input ends, and augments Azure service logging to help diagnose recognizer lifecycle behavior. Also updates workspace metadata and dev-dependency features needed for the new test’s tracing configuration.
Changes:
- Added an ignored Tokio integration test that starts Azure transcribe, streams short audio, then asserts a timely
Stoppedevent afterStop. - Added additional Azure transcribe service logging around connection and per-event reception.
- Enabled
tracing-subscriber’senv-filterfeature for tests and bumped workspace version.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/tests.rs | Adds ignored Azure shutdown regression test and Azure params helper. |
| services/azure/src/transcribe.rs | Adds connection debug logs and per-event trace logging for Azure recognizer. |
| Cargo.toml | Bumps workspace version and enables tracing-subscriber env-filter feature in dev-deps. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@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.
After we stopped audio, the following appeared in the log:
2026-08-05T12:09:13.048499Z ERROR context_switch::context_switch: Graceful shutdown period expired after waiting for 3000msEven though this situation is handled by sending an empty audio frame in azure-speech-sdk, the session is restarted and the event stream stays open.
The updates in the azure-speech-sdk submodule won't restart the session and wait for it to end and then ends the event stream.