Repository navigation
Conversation
Contributor
Author
|
@longcw @chenghao-mou — small follow-up to #8028 territory (same file, independent). Would you mind taking a look when you have a moment? |
Contributor
There was a problem hiding this comment.
Devin Review found 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
…ush() flush() closed the segment's byte stream in a fire-and-forget task and never read its result, so a close failing after the room disconnected surfaced as "Task exception was never retrieved". Await the close in a small coroutine and log the failure: debug once the room is gone, warning while it is still connected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
regalmoix
force-pushed
the
fix/avatar-flush-close-error
branch
from
October 21, 2026 14:16
f366369 to
bb7db5e
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Closing to retrigger CI — unit-tests hit the same unrelated |
Contributor
|
@karlsonlee-livekit If you could recall we discussed about this types of failure and better end call handling. Does this fix the issue? |
This branch has not been deployed
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.
flush()closes the segment's byte stream in a fire-and-forget task and never reads its result. When the room disconnects mid-reply (e.g. the user leaves), the close fails and asyncio logsTask exception was never retrievedwith a traceback at teardown:room.disconnect()drops the participant's open writer handles, so the close request hits a dropped handle and the FFI client raisesAssertionError.aclose()raisesStreamError.Fix
aclose()now runs in a small coroutine that logs a failure instead of leaving it unretrieved. It logs at debug when the room is already disconnected, the expected teardown case with nothing to recover. It logs at warning if the room is still connected, because then the avatar never got the end of the segment. This matches the transcription writer close inroom_io/_output.py.Testing
test_flush_close_failure_is_handled: the writer'saclose()raises. The test asserts that the flush task completes and that the warning is logged. Onmainit fails with the rawStreamError.tests/test_datastream_audio_output.py,tests/test_audio_sink_proxy.pyandtests/test_plugin_keyframe.pypass. ruff is clean, andmake type-checkreports no new errors.Why no regression
_tasks.KeyframeAudioOutputalready has its own_close_stream, so the new helper has a different name and Keyframe is untouched.