stainlessai / micronaut-jupyter

A Micronaut configuration that integrates your app with an existing Jupyter installation.
https://stainlessai.github.io/micronaut-jupyter
Apache License 2.0
9 stars 5 forks source link

MJ-11 ⁃ Support restarting and killing the kernel #11

Closed stainlessbot closed 4 years ago

stainlessbot commented 4 years ago

Currently, when the kernel is restarted or killed by Jupyter, the micronaut app is also killed (MJ-9). Any subsequent requests to start a new kernel will then fail. However, even if the app wasn't killed, a subsequent kernel request that uses the same ports as the old kernel may fail if the old kernel isn't properly terminated.

When the kernel is restarted/killed, ensure that the kernel thread itself is properly shutdown, but that the app stays up and running. It may be necessary to add additional logic to the bash script as discussed in MJ-6, but possibly not.

┆Issue Type: Bug ┆Priority: High ┆Status: Resolved ┆Fix Versions: v0.1.0 ┆Issue Number: MJ-11 ┆Epic: Kernel

stainlessbot commented 4 years ago

➤ Joshua Carter commented:

BeakerX has a closeKernelAction property on the Configuration class (interface with single close method, can be coerced in Groovy), it may be best to use that method to handle the kernel restart/kill command, and then have a generic failure handler that intercepts the System.exit() call in MJ-9.

stainlessbot commented 4 years ago

➤ Joshua Carter commented:

Unfortunately, the Configuration class is new in version 1.5.0, which hasn't been released yet.

stainlessbot commented 4 years ago

➤ Joshua Carter commented:

However, pre 1.5.0, most the the Configuration class was arguments passed to the Groovy kernel constructor, one of which was the closeKernelAction, so we can still do it.