This PR fixes a potential timing issue for clients that issue commands sequentially.
The OrderedShellHandler is used in order to cause pending cell executions to be aborted whenever the current cell execution fails. This is for the scenario where a bunch of notebook cells are executed quickly -- if one fails, we want to cancel the execution of the rest of the cells.
However, if a client is triggering new cell executions immediately after the previous one finishes (which happens, e.g. when executing a notebook using jupyter nbconvert, or when the IQ# kernel is being driven from Python), there is a race condition where the previous cell's failure may cause the new cell execution to be aborted (even though it was not queued until after the failure of the first one).
The fix is to ensure that OrderedShellHandler processes the completion of a cell before sending the execute_reply message back to the client.
This PR fixes a potential timing issue for clients that issue commands sequentially.
The
OrderedShellHandler
is used in order to cause pending cell executions to be aborted whenever the current cell execution fails. This is for the scenario where a bunch of notebook cells are executed quickly -- if one fails, we want to cancel the execution of the rest of the cells.However, if a client is triggering new cell executions immediately after the previous one finishes (which happens, e.g. when executing a notebook using
jupyter nbconvert
, or when the IQ# kernel is being driven from Python), there is a race condition where the previous cell's failure may cause the new cell execution to be aborted (even though it was not queued until after the failure of the first one).The fix is to ensure that
OrderedShellHandler
processes the completion of a cell before sending theexecute_reply
message back to the client.This is required for addressing https://github.com/microsoft/iqsharp/issues/310. IQ# will then need to consume a new release of Microsoft.Jupyter.Core containing this fix.