[VoiceLive] Fix issues: remove unnecessary subscribeOn, fix Disposable leaks, add graceful session close#48343
Open
[VoiceLive] Fix issues: remove unnecessary subscribeOn, fix Disposable leaks, add graceful session close#48343
Conversation
… Disposable leaks, remove phi4 models, add graceful session close - Remove subscribeOn(Schedulers.boundedElastic()) from parseToSessionUpdate() in VoiceLiveSessionAsyncClient to avoid per-event thread pool scheduling overhead - Store and dispose Disposable from receiveEvents().subscribe() in all 8 test files to prevent thread leaks - Remove phi4-mm-realtime and phi4-mini models from test parameter providers (not deployed in test region) - Remove unnecessary subscribeOn from MicrophoneInputSample and VoiceAssistantSample - Add session.close() to shutdown hooks in VoiceAssistantSample, FunctionCallingSample, and MCPSample to prevent NumberFormatException on Ctrl+C shutdown - Update CHANGELOG.md
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the VoiceLive Java SDK and related tests/samples to reduce Reactor scheduling overhead, address resource leaks, and improve shutdown/cleanup behavior.
Changes:
- Removed unnecessary
subscribeOn(Schedulers.boundedElastic())usage in the session event parsing pipeline and in audio sending within samples. - Updated live tests to track and dispose
Disposablesubscriptions, and removed unsupportedphi4-*models from test parameters. - Added more graceful session shutdown behavior in samples and updated the changelog.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/voicelive/azure-ai-voicelive/src/main/java/com/azure/ai/voicelive/VoiceLiveSessionAsyncClient.java | Removes per-event subscribeOn from parsing path. |
| sdk/voicelive/azure-ai-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveVoicePropertiesTests.java | Removes phi4 model; stores Disposable subscription (but cleanup not in finally). |
| sdk/voicelive/azure-ai-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveAudioTests.java | Removes phi4 models; stores Disposable subscriptions (but cleanup not in finally). |
| sdk/voicelive/azure-ai-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveAudioFormatTests.java | Removes phi4 models; adds Disposable; re-enables a test (removes @Disabled). |
| sdk/voicelive/azure-ai-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveConversationTests.java | Stores Disposable subscriptions (but cleanup not in finally). |
| sdk/voicelive/azure-ai-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveTranscriptionTests.java | Stores Disposable subscriptions (but cleanup not in finally). |
| sdk/voicelive/azure-ai-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveTurnDetectionTests.java | Disposes subscriptions in finally. |
| sdk/voicelive/azure-ai-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveToolCallTests.java | Disposes subscriptions in finally. |
| sdk/voicelive/azure-ai-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveSessionTests.java | Disposes subscriptions in finally. |
| sdk/voicelive/azure-ai-voicelive/src/samples/java/com/azure/ai/voicelive/VoiceAssistantSample.java | Removes subscribeOn and adds shutdown/cleanup session close. |
| sdk/voicelive/azure-ai-voicelive/src/samples/java/com/azure/ai/voicelive/MicrophoneInputSample.java | Removes subscribeOn on audio send. |
| sdk/voicelive/azure-ai-voicelive/src/samples/java/com/azure/ai/voicelive/MCPSample.java | Adds session close on shutdown and on termination. |
| sdk/voicelive/azure-ai-voicelive/src/samples/java/com/azure/ai/voicelive/FunctionCallingSample.java | Adds session close on shutdown and on termination. |
| sdk/voicelive/azure-ai-voicelive/CHANGELOG.md | Notes removal of unnecessary subscribeOn in event parsing pipeline. |
...-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveVoicePropertiesTests.java
Show resolved
Hide resolved
...ive/azure-ai-voicelive/src/main/java/com/azure/ai/voicelive/VoiceLiveSessionAsyncClient.java
Show resolved
Hide resolved
...e-ai-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveAudioFormatTests.java
Show resolved
Hide resolved
...-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveVoicePropertiesTests.java
Show resolved
Hide resolved
...-ai-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveConversationTests.java
Show resolved
Hide resolved
...ai-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveTranscriptionTests.java
Show resolved
Hide resolved
...ai-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveTranscriptionTests.java
Show resolved
Hide resolved
...e/azure-ai-voicelive/src/test/java/com/azure/ai/voicelive/livetests/VoiceLiveAudioTests.java
Show resolved
Hide resolved
...icelive/azure-ai-voicelive/src/samples/java/com/azure/ai/voicelive/VoiceAssistantSample.java
Show resolved
Hide resolved
...celive/azure-ai-voicelive/src/samples/java/com/azure/ai/voicelive/FunctionCallingSample.java
Show resolved
Hide resolved
…tdown hooks - Convert 13 test methods across 5 files from try/catch(Exception) to try/finally so subscription.dispose() and closeSession() run even on AssertionError - Replace unbounded session.close() with closeAsync().block(Duration.ofSeconds(5)) in shutdown hooks of VoiceAssistantSample, FunctionCallingSample, and MCPSample to prevent hanging during JVM teardown
Member
Author
|
/azp run |
|
Command 'run
java' is not supported by Azure Pipelines. Supported commands
See additional documentation. |
Member
Author
|
/azp run java - azure-ai-voicelive - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
… Disposable leaks, remove phi4 models, add graceful session close
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines