Skip to content

Conversation

@longcw
Copy link
Contributor

@longcw longcw commented Dec 10, 2025

add interruption timeout to SpeechHandle, cancel the tasks of the speech and mark it as done if it's not done before the timeout, to avoid any potential deadlock that waiting for the speech playout.

@longcw longcw requested a review from a team December 10, 2025 08:02
for task in self._tasks:
task.cancel()
if self._generations:
self._mark_generation_done()
Copy link
Member

Choose a reason for hiding this comment

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

nitpicking: we don't need these two lines, right? They are also called in _mark_done.

self._interrupt_fut.set_result(None)

def _on_timeout() -> None:
logger.error(
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to check the done state again here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

both _mark_done and the timeout handle are sync method, the _on_timeout is only called when _mark_done isn't called.

Copy link
Member

@chenghao-mou chenghao-mou left a comment

Choose a reason for hiding this comment

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

LGTM! Minor duplication from the first comment.

@longcw longcw merged commit 9263b32 into main Dec 16, 2025
18 checks passed
@longcw longcw deleted the longc/add-interruption-timeout branch December 16, 2025 07:48
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.

3 participants