- To disable, set
cleanupConnectionFile
tofalse
in thespawnOptions
:launch(kernelName, { cleanupConnectionFile: false });
- Otherwise, the default will still be to remove the connection file on process exit
Replaced child_process.spawn
with execa
-
In order to improve kernel process cleanup
-
execa
is built on top ofchild_process
in a backward compatible fashion and returns aChildProcess
instance, so you will most likely not need to change anything to upgrade fromv4.0.0
-
Usage and arguments are backward compatible:
launch(kernelName, specs, spawnOptions)
launchSpec(kernelSpec, spawnOptions)
launchSpecFromConnectionInfo(kernelSpec, config, connectionFile, spawnOptions)
The differences are:
-
spawnOptions
will supportexeca
options, a superset ofchild_process
options, adding functionality outlined in theexeca
API docs. -
While the
spawnResults
object is still an instance ofChildProcess
,execa
adds some additional properties, which may or may not ever be useful for kernel processes.
From the docs, execa
:
returns a
ChildProcess
instance, which is enhanced to also be a Promise for a result Object with stdout and stderr properties.
- Once a kernel launched with
spawnteract
exits or errors out,spawnteract
will attempt to delete that kernel's connection file. - This will fail silently if the connection file is missing or any other potential problem prevents the file from being found and removed.