diff --git a/ipykernel/kernelbase.py b/ipykernel/kernelbase.py index eb9de54a..6522dd1d 100644 --- a/ipykernel/kernelbase.py +++ b/ipykernel/kernelbase.py @@ -469,7 +469,8 @@ async def process_shell_message(self, msg=None, socket=None): elif received_time - self._aborted_time > self.stop_on_error_timeout: self._aborting = False if self._aborting: - await self._send_abort_reply(self.shell_socket, msg, idents) + # await self._send_abort_reply(self.shell_socket, msg, idents) + await self._send_abort_reply(socket, msg, idents) self._publish_status("idle", "shell") return @@ -479,7 +480,8 @@ async def process_shell_message(self, msg=None, socket=None): self.log.debug("\n*** MESSAGE TYPE:%s***", msg_type) self.log.debug(" Content: %s\n --->\n ", msg["content"]) - if not await self.should_handle(self.shell_socket, msg, idents): + # if not await self.should_handle(self.shell_socket, msg, idents): + if not await self.should_handle(socket, msg, idents): return handler = self.shell_handlers.get(msg_type) diff --git a/ipykernel/subshell_manager.py b/ipykernel/subshell_manager.py index 4fd29061..c1287af9 100644 --- a/ipykernel/subshell_manager.py +++ b/ipykernel/subshell_manager.py @@ -44,7 +44,7 @@ def __init__(self, context: zmq.asyncio.Context, shell_socket: zmq.asyncio.Socke self._shell_socket = shell_socket self._cache: dict[str, Subshell] = {} self._lock_cache = Lock() - self._lock_shell_socket = Lock() + # self._lock_shell_socket = Lock() # Inproc pair sockets for control channel and main shell (parent subshell). # Each inproc pair has a "shell_channel" socket used in the shell channel @@ -232,8 +232,8 @@ async def _listen_for_subshell_reply(self, subshell_id: str | None) -> None: try: while True: msg = await shell_channel_socket.recv_multipart(copy=False) - with self._lock_shell_socket: - self._shell_socket.send_multipart(msg) + # with self._lock_shell_socket: + self._shell_socket.send_multipart(msg) except BaseException as e: if not self._is_subshell(subshell_id): # Subshell no longer exists so exit gracefully