vericast / spylon-kernel

Jupyter kernel for scala and spark
Other
187 stars 38 forks source link

Long-running cell results are sometimes returned to wrong cell #21

Closed patrick-nicholson closed 7 years ago

patrick-nicholson commented 7 years ago

When executing many cells at once, the occasional long-running (by execution time) cell has its output delivered to the next cell. This seems like it happens most often with minute-runtime-level cell followed by a millisecond-runtime-level cell.

I am not able to reproduce an example on demand, it just happens when it happens.

parente commented 7 years ago

Probably due to the ordering of the messages. The kernel has to send the idle status message after sending all of the output to the notebook frontend.

mariusvniekerk commented 7 years ago

Is that a metakernel issue then?

parente commented 7 years ago

I think the async file reader code is a more likely suspect. It's happening asynchronously from the execute request completing.

parente commented 7 years ago

While toying with the fix for #26, I confirmed this is indeed due to iopub messages with display_output / stream output arriving after the kernel goes idle for the cell code that generated them. Will need to work on a synchronization strategy to fix.