We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fb85fc2 commit 1752121Copy full SHA for 1752121
1 file changed
template/server/messaging.py
@@ -393,7 +393,17 @@ async def _receive_message(self):
393
await self._process_message(json.loads(message))
394
except Exception as e:
395
logger.error(f"WebSocket received error while receiving messages: {str(e)}")
396
- await self.reconnect()
+ finally:
397
+ # To prevent infinite hang, we need to cancel all ongoing execution as we could lost results during the reconnect
398
+ for key, execution in self._executions.items():
399
+ await execution.queue.put(
400
+ Error(
401
+ name="WebSocketError",
402
+ value="The connections was lost, rerun the code to get the results",
403
+ traceback="",
404
+ )
405
406
+ await execution.queue.put(UnexpectedEndOfExecution())
407
408
async def _process_message(self, data: dict):
409
"""
0 commit comments