Merge pull request #2924 from pipecat-ai/aleix/daily-transport-remove-join-timeout

DailyTransport: don't timeout prematurely on join
This commit is contained in:
Aleix Conchillo Flaqué
2025-10-28 10:43:28 -07:00
committed by GitHub
2 changed files with 29 additions and 36 deletions

View File

@@ -20,6 +20,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Fixed an issue where `DailyTransport` would timeout prematurely on join and on
leave.
- Fixed an issue in the runner where starting a DailyTransport room via - Fixed an issue in the runner where starting a DailyTransport room via
`/start` didn't support using the `DAILY_SAMPLE_ROOM_URL` env var. `/start` didn't support using the `DAILY_SAMPLE_ROOM_URL` env var.

View File

@@ -744,7 +744,6 @@ class DailyTransportClient(EventHandler):
self._client.set_user_name(self._bot_name) self._client.set_user_name(self._bot_name)
try:
(data, error) = await self._join() (data, error) = await self._join()
if not error: if not error:
@@ -765,11 +764,7 @@ class DailyTransportClient(EventHandler):
error_msg = f"Error joining {self._room_url}: {error}" error_msg = f"Error joining {self._room_url}: {error}"
logger.error(error_msg) logger.error(error_msg)
await self._callbacks.on_error(error_msg) await self._callbacks.on_error(error_msg)
except asyncio.TimeoutError:
error_msg = f"Time out joining {self._room_url}"
logger.error(error_msg)
self._joining = False self._joining = False
await self._callbacks.on_error(error_msg)
async def _join(self): async def _join(self):
"""Execute the actual room join operation.""" """Execute the actual room join operation."""
@@ -828,7 +823,7 @@ class DailyTransportClient(EventHandler):
}, },
) )
return await asyncio.wait_for(future, timeout=10) return await future
async def leave(self): async def leave(self):
"""Leave the Daily room and cleanup resources.""" """Leave the Daily room and cleanup resources."""
@@ -854,7 +849,6 @@ class DailyTransportClient(EventHandler):
for track_name, _ in self._custom_audio_tracks.items(): for track_name, _ in self._custom_audio_tracks.items():
await self.remove_custom_audio_track(track_name) await self.remove_custom_audio_track(track_name)
try:
error = await self._leave() error = await self._leave()
if not error: if not error:
logger.info(f"Left {self._room_url}") logger.info(f"Left {self._room_url}")
@@ -863,10 +857,6 @@ class DailyTransportClient(EventHandler):
error_msg = f"Error leaving {self._room_url}: {error}" error_msg = f"Error leaving {self._room_url}: {error}"
logger.error(error_msg) logger.error(error_msg)
await self._callbacks.on_error(error_msg) await self._callbacks.on_error(error_msg)
except asyncio.TimeoutError:
error_msg = f"Time out leaving {self._room_url}"
logger.error(error_msg)
await self._callbacks.on_error(error_msg)
async def _leave(self): async def _leave(self):
"""Execute the actual room leave operation.""" """Execute the actual room leave operation."""
@@ -875,7 +865,7 @@ class DailyTransportClient(EventHandler):
future = self._get_event_loop().create_future() future = self._get_event_loop().create_future()
self._client.leave(completion=completion_callback(future)) self._client.leave(completion=completion_callback(future))
return await asyncio.wait_for(future, timeout=10) return await future
def _cleanup(self): def _cleanup(self):
"""Cleanup the Daily client instance.""" """Cleanup the Daily client instance."""