Is there a proper way to stop the nrepl server from a client session? Running stop-server
from a client connection causes the following error on the server (likely because it first closes the server socket and then tries to close each transport, flushing whatever remains, and perhaps fails to write repsonse to the closing statement):
Exception in thread "nREPL-worker-0" java.lang.Error: java.net.SocketException: Socket closed
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1155)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.SocketException: Socket closed
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:118)
at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at nrepl.transport$bencode$fn__725.invoke(transport.clj:103)
at nrepl.transport.FnTransport.send(transport.clj:28)
at nrepl.middleware.pr_values$printing_transport$reify__1137.send(pr_values.clj:40)
at nrepl.middleware.interruptible_eval$evaluate$fn__1179$fn__1192.invoke(interruptible_eval.clj:135)
at clojure.main$repl$fn__9077.invoke(main.clj:437)
at clojure.main$repl.invokeStatic(main.clj:435)
at clojure.main$repl.doInvoke(main.clj:345)
at clojure.lang.RestFn.invoke(RestFn.java:1523)
at nrepl.middleware.interruptible_eval$evaluate$fn__1179.invoke(interruptible_eval.clj:93)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:665)
at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1973)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1973)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at nrepl.middleware.interruptible_eval$evaluate.invokeStatic(interruptible_eval.clj:91)
at nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:60)
at nrepl.middleware.interruptible_eval$interruptible_eval$fn__1221$fn__1224.invoke(interruptible_eval.clj:231)
at nrepl.middleware.interruptible_eval$run_next$fn__1216.invoke(interruptible_eval.clj:199)
at clojure.lang.AFn.run(AFn.java:22)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
... 2 more
And the client cannot be stopped with ctrl-C due to Exception in thread "SIGINT handler" java.net.SocketException: Broken pipe (Write failed)