A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
fix: make recv robust to EAGAIN, EDEADLK (#1822)
Akshay Agrawal5b62b28ffd92
diff --git a/marimo/_utils/distributor.py b/marimo/_utils/distributor.pyindex 9241a4e892..7f77ba689e 100644--- a/marimo/_utils/distributor.py+++ b/marimo/_utils/distributor.py@@ -2,6 +2,7 @@from __future__ import annotationsimport asyncio+import timefrom typing import TYPE_CHECKING, Callable, Generic, TypeVarfrom marimo import _loggers@@ -49,9 +50,17 @@ class Distributor(Generic[T]):def _on_change(self) -> None:"""Distribute the response to all consumers."""+ retry_sleep_seconds = 0.001while self.input_connection.poll():try:response = self.input_connection.recv()+ except BlockingIOError as e:+ # recv() sporadically fails with EAGAIN, EDEADLK ...+ LOGGER.warning(+ "BlockingIOError in distributor receive: %s", str(e)+ )+ time.sleep(retry_sleep_seconds)+ continueexcept (EOFError, StopIteration):breakfor consumer in self.consumers: