-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove loop=loop in asyncio.wait call. Fix #245 #258
Conversation
@lf- This PR is not enough.
|
That's absolutely bizarre. The implication of run_in_executor further up in that stack is that there is in fact a current event loop, so I really don't know what the issue is. Can someone else help? |
@tinmarino Any ideas? |
@NeilGirdhar sry no idea, no time to investigate. It seems that the thread registration has changed. To troubleshoot, see if removing the await keyword works. In that case, maybe divide this line in 2: |
@tinmarino Thank you very much for the pointers! Very kind of you. Sorry if my ping was an imposition. I just saw you as the last person to touch these lines. Have a nice summer break, que lo pases bien. 😄 |
@NeilGirdhar that was fast ! Do not worry, I am actually glad (proud) you called for my point of view 😎. |
I don't use jupyter for anything, but we're looking at this patch for Void Linux in void-linux/void-packages#35376. Looking very narrowly, this seems to be wrong because Note that I suspect the right fix here is to move the body of the loop = asyncio.get_event_loop()
while True:
loop.run_until_complete(self.do_loop_body()) or something to that effect. This will allow things like |
I was able to dirty-fix that by async def handle_external_iopub(self, loop=None):
while self.keep_running:
# we need to check for keep_running from time to time as
# we are blocking in an executor block which cannot be cancelled.
# poll_result = await loop.run_in_executor(
# None, self.client.iopub_channel.socket.poll, 500)
poll_result = await self.client.iopub_channel.socket.poll(500)
if poll_result:
self.handle_iopub() Looks like run_in_executor() uses threadpool by default, and none of its threads have eventloop initialized. |
Fixes #245