Skip to content

Commit

Permalink
Fix event pipe ZMQ context
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Mar 13, 2024
1 parent c37329b commit c1dce80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ipykernel/iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def _event_pipe(self):
event_pipe = self._local.event_pipe
except AttributeError:
# new thread, new event pipe
ctx = self.socket.context
ctx = zmq.Context(self.socket.context)

This comment has been minimized.

Copy link
@blink1073

blink1073 Mar 13, 2024

Contributor

For me locally this had raised a pyzmq error

This comment has been minimized.

Copy link
@davidbrochart

davidbrochart Mar 14, 2024

Author Collaborator

The reason for this change is to create a shadow (sync) context from self.socket.context, which is an async context. We pull asynchronously from the socket, but we must push synchronously because all the code is not async.
Could you check that this still raises a pyzmq error, and what is this error?

This comment has been minimized.

Copy link
@blink1073

blink1073 Mar 15, 2024

Contributor

I don't see an error any more, the test suite times out during tests/test_kernel.py::test_raw_input

This comment has been minimized.

Copy link
@davidbrochart

davidbrochart Mar 19, 2024

Author Collaborator

Fixed in 09dbf86. This was in my first commit, but removed later.

event_pipe = ctx.socket(zmq.PUSH)
event_pipe.linger = 0
event_pipe.connect(self._event_interface)
Expand Down

0 comments on commit c1dce80

Please sign in to comment.