diff --git a/litellm/litellm_core_utils/streaming_handler.py b/litellm/litellm_core_utils/streaming_handler.py index fcfecf7c438..721287a6f41 100644 --- a/litellm/litellm_core_utils/streaming_handler.py +++ b/litellm/litellm_core_utils/streaming_handler.py @@ -109,7 +109,8 @@ class _SyncIteratorToQueue: fut.result(timeout=0.5) return except TimeoutError: - fut.cancel() + if not fut.cancel(): + return continue except Exception: return