Skip to content

Catch missing DELIM in feed_identities on shell and control channels - #1581

Open
vyrnsynx wants to merge 1 commit into
ipython:mainfrom
vyrnsynx:fix/catch-missing-delim-in-feed-identities
Open

vyrnsynx wants to merge 1 commit into
ipython:mainfrom
vyrnsynx:fix/catch-missing-delim-in-feed-identities

Conversation

@vyrnsynx

Copy link
Copy Markdown

Closes #1580

In Kernel.process_control, Kernel.dispatch_shell, and Kernel.shell_channel_thread_main, self.session.feed_identities(msg, copy=False) was called immediately before the try ... except Exception: block that wraps self.session.deserialize(...) (whereas Kernel.shell_main already wrapped both inside try ... except Exception:).

When a non-Jupyter connection or malformed message without the <IDS|MSG> delimiter arrives on the shell or control port, feed_identities raises ValueError: DELIM not in msg_list. Because shell_channel_thread_main and dispatch_control are registered directly as ZMQStream.on_recv callbacks in ipykernel 7, the uncaught ValueError escaped into ZMQStream._log_error (tornado.general), printing the traceback into the active notebook cell's stderr output instead of logging it to self.log.

Move feed_identities inside the existing try ... except Exception: blocks in process_control, dispatch_shell, and shell_channel_thread_main so malformed messages missing DELIM are logged via self.log.error(...) as in 6.x.

This branch has not been deployed

No deployments
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.

ipykernel 7: non-Jupyter connection to shell/control port shows "DELIM not in msg_list" traceback in notebook output (6.x logged it to the kernel log)

1 participant