Skip to content

Commit

Permalink
Propagate kernel restarts to users
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubno committed Sep 9, 2024
1 parent b536b32 commit d8831bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
16 changes: 0 additions & 16 deletions template/e2b.toml

This file was deleted.

6 changes: 6 additions & 0 deletions template/server/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ async def _process_message(self, data: dict):
:param data: The message data
"""
if data["msg_type"] == "status" and data['content']['execution_state'] == 'restarting':
logger.error("Kernel is restarting")
for execution in self._executions.values():
await execution.queue.put(Error(name="KernelRestarting", value="Kernel was restarted", traceback=""))
await execution.queue.put(EndOfExecution())
return

parent_msg_ig = data["parent_header"].get("msg_id", None)
if parent_msg_ig is None:
Expand Down

0 comments on commit d8831bd

Please sign in to comment.