From f37bf989dd80e57f96b6662a296624249ebe11a1 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Mon, 30 Mar 2026 12:29:46 -0400 Subject: [PATCH] Make reconnection failure error non-fatal to allow service failover A single service failing to reconnect should not kill the entire pipeline. Non-fatal errors flow through the pipeline so application code (e.g. ServiceSwitcher) can handle failover to a backup service. --- src/pipecat/services/websocket_service.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pipecat/services/websocket_service.py b/src/pipecat/services/websocket_service.py index e5449a539..9258aa90c 100644 --- a/src/pipecat/services/websocket_service.py +++ b/src/pipecat/services/websocket_service.py @@ -107,12 +107,12 @@ class WebsocketService(ABC): ) wait_time = exponential_backoff_time(attempt) await asyncio.sleep(wait_time) - fatal_msg = f"{self} failed to reconnect after {max_retries} attempts" + msg = f"{self} failed to reconnect after {max_retries} attempts" if last_exception: - fatal_msg += f": {last_exception}" - logger.error(fatal_msg) + msg += f": {last_exception}" + logger.error(msg) if report_error: - await report_error(ErrorFrame(fatal_msg, fatal=True)) + await report_error(ErrorFrame(msg)) return False finally: self._reconnect_in_progress = False