You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah. nrepl uses an interruptible evaluation that can sometimes be stopped. I think the fundamental tool they are relying on is deprecated though.
(defn-interrupt-stop"This works as follows 1. Calls interrupt 2. Wait 100ms. This is mainly to allow thread that respond quickly to interrupts to send a message back in response to the interrupt. Significantly, this includes an exception thrown by `Thread/sleep`. 3. Asynchronously: wait another 5000ms for the thread to cleanly terminate. Only calls `.stop` if it fails to do so (and risk state corruption) This set of behaviours strikes a balance between allowing a thread to respond to an interrupt, but also ensuring we actually kill runaway processes. If required, a future feature could make both timeouts configurable, either as a server config or parameters provided by the `interrupt` message."
[^Thread t]
(.interrupt t)
(Thread/sleep100)
(noisy-future
(Thread/sleep5000)
(when-not (= (Thread$State/TERMINATED)
(.getState t))
(.stop t))))
And .stop is deprecated as "inherently unsafe": javadocs
Well, there is also this I found about nrepl and rebel/readline, bhauman/rebel-readline#180 (comment).
But I do not know enough about nrepl and repl options to incooperate this :eval option in.
Expected behavior
Interrutps currently evaluted expression
Actual behavior
Kills inf-clojure session.
Steps to reproduce the problem
Put this into the repl, it sleeps for 1sec, and before it finishes evaluating. Interrupt it using
C-c C-c
.This will kill inf-clojure with this output
Environment & Version information
inf-clojure version information
3.2.1
Lein/Boot version
Clojure CLI version 1.11.1.1189
Emacs version
28.2
Operating system
Mac Monterey M1
The text was updated successfully, but these errors were encountered: