Dyalog / dyalog-jupyter-kernel

A Jupyter kernel for Dyalog APL
https://dyalog.github.io/dyalog-jupyter-kernel/
MIT License
64 stars 20 forks source link

Orphaned interpreters laying around #51

Closed bpbecker closed 10 months ago

bpbecker commented 6 years ago

Once the kernel is hosed, the associated interpreter task is left as an orphan. Parentless, wandering the streets, lonely... it's very sad.

rodrigogiraoserrao commented 3 years ago

I also experience this issue, although I can't vouch for the feelings of the associated interpreter task.

rikedyp commented 2 years ago

If you use the kernel interface to shut down running kernels, then Dyalog exits correctly. It seems the destructor doesn't do its job when the kernel is hosed. I'm not sure what can be done about this.

abrudz commented 2 years ago

Is there some way to detect from the APL side that the connection has been lost, e.g. by polling the kernel? If so, then we can have a Timer that checks once a minute and simply shuts the interpreter down if there's no connection.

rikedyp commented 2 years ago

Yeah you can use 3501⌶

abrudz commented 2 years ago

Then I believe adding 'Event'('Timer' '⍎{~⍵:⎕OFF}3501⌶⍬')⎕WS⍨'⎕SE.SelfCheck'⎕WC'Timer' 60E3 to dyalog_kernel/init.dyalog will shut the kernel down within a minute if it loses connection.