Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthomas23 committed Sep 17, 2024
1 parent 9669fcd commit 1a7609a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions ipykernel/kernelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions ipykernel/subshell_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1a7609a

Please sign in to comment.