Skip to content

Properly handle the Azure Recognizer shutdown after audio ended. - #95

Merged
pragmatrix merged 3 commits into
masterfrom
fix-azure-recognizer-shutdown
Aug 5, 2026
Merged

Properly handle the Azure Recognizer shutdown after audio ended.#95
pragmatrix merged 3 commits into
masterfrom
fix-azure-recognizer-shutdown

Conversation

@pragmatrix

@pragmatrix pragmatrix commented Aug 5, 2026

Copy link
Copy Markdown
Owner

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 3000ms

Even 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.

…ure recognizer after audio ended, and fix the problem in the azure-speech-sdk-rs
@pragmatrix
pragmatrix marked this pull request as ready for review August 5, 2026 12:34
@pragmatrix
pragmatrix requested a lite review from Copilot August 5, 2026 12:34
@pragmatrix pragmatrix changed the title Add a regression test for being able to promptly shutting down the az… Properly handle the Azure Recognizer shutdown after audio ended. Aug 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Stopped event after Stop.
  • Added additional Azure transcribe service logging around connection and per-event reception.
  • Enabled tracing-subscriber’s env-filter feature 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.

Comment thread src/tests.rs Outdated
Comment thread src/tests.rs
Comment thread services/azure/src/transcribe.rs
pragmatrix and others added 2 commits August 5, 2026 14:37
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>
@pragmatrix
pragmatrix merged commit 439baad into master Aug 5, 2026
2 of 3 checks passed
@pragmatrix
pragmatrix deleted the fix-azure-recognizer-shutdown branch August 5, 2026 12:39
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.

2 participants