Closed kevin-bates closed 4 years ago
Whew, OK.
Connection files: Maybe we need to think more about what connection files are and what parts are responsible for them. At the moment, they're used both to tell the kernel what ports it should bind to (provider/launcher responsibility), and to tell other applications what ports they should connect to (application responsibility?). Using the same connection file for both may not work if the kernel is launched somewhere remote. As a later step, I also want to move away from the launcher telling the kernel what ports to use.
Maybe the solution/workaround for now is for the application to write the connection info to a second connection file for the --existing
information, separate from the one the provider creates to launch the kernel?
Sync & async: I think the issue is that we're using an awkward jumble of synchronous and asynchronous APIs (which is my fault). The application runs its own event loop, but then tries to use a bunch of synchronous APIs, which are now wrappers around async ones. It should either use the async APIs inside its event loop, or stick to synchronous code.
I'm okay creating a second file. I think the test might require adjustment since I believe it assumes only one kernel-xxx.json file exists in runtime dir, but that's solvable. Also I'm a little weary about introducing another occurrence of secure_write
given the plethora of issues that have cropped up since its creation - primarily down to Windows and NFS issues at this point.
I'll try to spend some "quality time" on the async issues, although I'm essentially on holiday through the New Year (Happy New Year! :tada:).
Closing in favor of #42. (It's also the answer to the universe!)
These changes update kernelapp to be closer to what they should be (tests passes), but the application still doesn't work correctly.
Problem areas:
--existing
isn't applicable. I have just dumped the connection info, but that's probably a security violation now that I thin about ti.When I run
python -c "from jupyter_kernel_mgmt.kernelapp import main; main()"
from the command line, I see the following (which seems correct)...I then locate the process id (essentially simulating what the test is doing) and issue
kill pid
, then get the following...So although the test "passes", these issues are masked.
Fixes: #40