The Jupyter protocol relies on ZMQ 'multipart' messages. IIRC, a multipart message is a series of individual messages with the SNDMORE flag set on all but the last one. I don't know if those parts are meant to be separated out again if two threads are sending parts interleaved to the same endpoint.
On 19 December 2017 at 12:28, Christian Schafmeister < [email protected]> wrote: > I'm certain it's a problem on my kernel side, it has to do with sending > messages to jupyter and not receiving them from jupyter. The messages are > send out using multiple calls to the pzmq:send function and when multiple > threads were doing this at the same time the messages got garbled. I > wrapped the sending code in a mutex and the problem went away. > I don't think it's a jupyter issue. > > On Tuesday, December 19, 2017 at 2:00:33 AM UTC-5, Roland Weber wrote: >> >> On Monday, December 18, 2017 at 3:00:23 PM UTC+1, Christian Schafmeister >> wrote: >>> >>> I fixed the problem last night - it turned out to be a threading issue. >>> When I rapidly evaluated notebook cells (hitting shift-enter really >>> fast) the Python in Jupyter Notebook would crash as shown. >>> Multiple processes were calling the pzmq:send function at the same time >>> and the messages were becoming interleaved and garbled. >>> I wrapped a mutex around the function that calls pzmq:send multiple >>> times and the problem went away. >>> >> >> That sounds like a serious bug. Jupyter is supposed to handle >> simultaneous requests from multiple clients to the same kernel, afaik. This >> should not garble messages. >> >> Are you sure that the problem is on the sending side? Or could it be that >> your kernel expects messages in sequence, although the messaging protocol >> makes no guarantees about that? It's not impossible that you found a >> problem in Jupyter. But it seems strange that something so fundamental >> would have gone unnoticed until now. >> >> If you think that problem is in Jupyter, please open an issue and point >> us to the code where you had to implement the fix. >> >> best regards, >> Roland >> > -- > You received this message because you are subscribed to the Google Groups > "Project Jupyter" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/jupyter/c190dae1-cf7d-43d8-99ec-943ca48ba71e%40googlegroups.com > <https://groups.google.com/d/msgid/jupyter/c190dae1-cf7d-43d8-99ec-943ca48ba71e%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Project Jupyter" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CAOvn4qiBRq1v81XB_2RktDDk_t--9jC%3DW-pHoq6%3DF18qvtk1rg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
