achesnais / clj-jupyter

A Clojure Kernel for Jupyter Notebooks
Eclipse Public License 1.0
43 stars 12 forks source link

Switching namespaces kills kernel #3

Open klsmithphd opened 8 years ago

klsmithphd commented 8 years ago

Issuing in-ns to switch/create a namespace appears to kill the clj-jupyter kernel.

For example, entering this in the notebook and executing:

(in-ns 'myapp)

ends up producing this stack trace (not in the notebook, but rather emitted by the jupyter process):

                              java.lang.Thread.run              Thread.java:  745
java.util.concurrent.ThreadPoolExecutor$Worker.run  ThreadPoolExecutor.java:  617
 java.util.concurrent.ThreadPoolExecutor.runWorker  ThreadPoolExecutor.java: 1142
               java.util.concurrent.FutureTask.run          FutureTask.java:  266
                                               ...                               
               clojure.core/binding-conveyor-fn/fn                 core.clj: 1938
                        clj-jupyter.shell/start/fn                shell.clj:  289
                   clj-jupyter.shell/handler-fn/fn                shell.clj:  269
                 clj-jupyter.shell/response-map/fn                shell.clj:  217
           clj-jupyter.shell.REPL/eval-code-to-str                shell.clj:  140
                  clj-jupyter.shell.REPL/eval-code                shell.clj:  128
                            clojure.core/transduce                 core.clj: 6601
                       clojure.core.protocols/fn/G            protocols.clj:   13
                         clojure.core.protocols/fn            protocols.clj:   75
                 clojure.core.protocols/seq-reduce            protocols.clj:   31
                       clojure.core.protocols/fn/G            protocols.clj:   19
                         clojure.core.protocols/fn            protocols.clj:  167
                         clojure.core/filter/fn/fn                 core.clj: 2697
                            clojure.core/map/fn/fn                 core.clj: 2633
                         clj-jupyter.shell.REPL/fn                shell.clj:  132
                          clojure.core/read-string                 core.clj: 3687
                                               ...                               
java.lang.RuntimeException: No reader function for tag object

The heartbeat appears to work correctly and a new kernel is started after a short while, but this seems to consistently kill the kernel.

achesnais commented 7 years ago

@Ken-2scientists thanks for raising this and apologies for looking only now.

I'll have a look at the proposed tag handling fixed, and if it doesn't fix it I'll investigate further, as ns handling is pretty important imo.