Skip to content

Commit 2af91b2

Browse files
committed
More robustness in status updater
1 parent 3fb1035 commit 2af91b2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/psij/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,18 @@ def step(self) -> None:
145145
self._process_update_data(data)
146146
except TimeoutError:
147147
pass
148+
except socket.timeout:
149+
# before 3.10, this was a separate exception from TimeoutError
150+
pass
148151
except BlockingIOError:
149152
pass
150153

151154
def run(self) -> None:
152155
while True:
153-
self.step()
156+
try:
157+
self.step()
158+
except Exception:
159+
logger.exception('Exception in status updater thread. Ignoring.')
154160

155161
def flush(self) -> None:
156162
# Ensures that, upon return from this call, all updates available before this call have

0 commit comments

Comments
 (0)