nbclient icon indicating copy to clipboard operation
nbclient copied to clipboard

fix blocking issue when cell contains ipywidget

Open hjliu0206 opened this issue 1 year ago • 8 comments

fix blocking issue when cell contains ipywidget

hjliu0206 avatar May 13 '24 03:05 hjliu0206

link to the issue : https://github.com/jupyter/nbclient/issues/312

hjliu0206 avatar May 13 '24 03:05 hjliu0206

@blink1073 hi , blink, can you review my merge request ?

hjliu0206 avatar May 13 '24 03:05 hjliu0206

Thanks @hjliu0206 for opening an issue and a PR. I'm not sure the fix should be here though, but rather upstream in jupyter-client. It seems to me that kernel_client.shell_channel.get_msg(timeout=None) should return the message when it receives it, not after a timeout.

davidbrochart avatar May 13 '24 08:05 davidbrochart

@davidbrochart hello , david, it's nbclient module block and pulls messages from the shell channel while sending messages to shell channel , most of the logic written in the nbclient , I'm not sure how to modify the jupyter client to fix this problem image image

hjliu0206 avatar May 13 '24 09:05 hjliu0206

@davidbrochart If I make this change in my own company's branch of the project , do you think does there exist any potential problems ?

hjliu0206 avatar May 13 '24 09:05 hjliu0206

@davidbrochart If I make this change in my own company's branch of the project , do you think does there exist any potential problems ?

No, you are free to fork nbclient, but this might not be the best solution. Maybe @maartenbreddels has ideas about the issue, since he's been involved in the output widget IIRC.

davidbrochart avatar May 13 '24 09:05 davidbrochart

Changing the code to %matplotlib inline (from %matplotlib widget) allows this example to succeed. So I suspect it is blocking due to some assumption in the widget engine

dleen avatar Jul 09 '24 01:07 dleen

Changing the code to %matplotlib inline (from %matplotlib widget) allows this example to succeed. So I suspect it is blocking due to some assumption in the widget engine

@dleen hello, when you replace with %matplotlib inline, just render static image , will not sync widget data to kernel, the bug occured when nbconvert need send widget status data to the kernel , and then pull data from the kernel

hjliu0206 avatar Jul 19 '24 07:07 hjliu0206