Skip to content

Handle kernel dead status message in iopub polling#349

Open
dualc wants to merge 1 commit into
jupyter:mainfrom
dualc:fix/handle-dead-kernel-iopub-message
Open

Handle kernel dead status message in iopub polling#349
dualc wants to merge 1 commit into
jupyter:mainfrom
dualc:fix/handle-dead-kernel-iopub-message

Conversation

@dualc

@dualc dualc commented Jun 15, 2026

Copy link
Copy Markdown

When a kernel dies, the gateway server broadcasts an iopub status message with execution_state="dead". Previously this message was silently discarded because it doesn't match the current cell's parent_msg_id.

Now _async_poll_output_msg checks for the dead status before filtering by parent_msg_id, and cancels task_poll_for_reply to trigger DeadKernelError in the main execution flow. This mirrors how _async_poll_kernel_alive handles kernel death detection.

This is particularly important for Jupyter Gateway/Enterprise Gateway deployments where the kernel runs on a remote server and the local KernelManager may not detect death through other channels promptly.

When a kernel dies, the gateway server broadcasts an iopub status message
with execution_state="dead". Previously this message was silently discarded
because it doesn't match the current cell's parent_msg_id.

Now _async_poll_output_msg checks for the dead status before filtering by
parent_msg_id, and cancels task_poll_for_reply to trigger DeadKernelError
in the main execution flow. This mirrors how _async_poll_kernel_alive
handles kernel death detection.

This is particularly important for Jupyter Gateway/Enterprise Gateway
deployments where the kernel runs on a remote server and the local
KernelManager may not detect death through other channels promptly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant