This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-06-03
Channels
- # aws (12)
- # beginners (12)
- # biff (10)
- # calva (1)
- # cider (10)
- # cljfx (1)
- # clojure (2)
- # clojure-conj (1)
- # clojure-europe (25)
- # clojure-madison (1)
- # clojure-nl (1)
- # clojure-norway (12)
- # clojure-sweden (4)
- # clojure-uk (6)
- # datomic (11)
- # dev-tooling (3)
- # emacs (5)
- # gratitude (1)
- # introduce-yourself (7)
- # java (3)
- # jobs (1)
- # london-clojurians (2)
- # lsp (23)
- # off-topic (4)
- # practicalli (9)
- # quil (6)
- # re-frame (3)
- # reagent (4)
- # remote-jobs (1)
- # ring (1)
- # shadow-cljs (18)
- # squint (67)
- # tools-deps (5)
- # xtdb (4)
- # yamlscript (12)
Dear CIDER users, this is my third call to help us test the fixed eval interrupt functionality in Java 21 and newer. All the necessary code is already in CIDER master, so all you have to do is:
1. Update to the latest CIDER from MELPA unstable.
2. In Emacs do M-x customize-variable cider-enable-nrepl-jvmti-agent
=> on (`t`).
3. Jack in into a project with Java 21 or newer. The project can use either tools.deps, Leiningen, or Gradle.
4. Evaluate (while true)
.
5. Verify in htop
that Clojure process utilizes 100% of CPU (that is 1 core).
6. Interrupt evaluation in CIDER, check htop
that CPU is not spinning anymore.
7. Switch to *nrepl-server ...*
buffer and look for lines saying something like this:
nREPL native agent loaded
Stopping thread "nREPL-session-6d69746a-981f-4b72-89be-35b0dcfa20c9" using JVMTI...
Just have tried on MacOS with M1 CPU. I didn't notice that 1 core is fully utilized in htop even after waiting for some time. Other than that evaluation was interrupted successfully and I saw the following in the nrepl-server...
log:
nREPL server started on port 54323 on host localhost -
WARNING: A JVM TI agent has been loaded dynamically (/var/folders/cj/3clz_t8j7tl9xqrpyth1471c0000gn/T/nrepl5058351778692009894/libnrepl-macos-universal.so)
WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
WARNING: Dynamic loading of agents will be disallowed by default in a future release
nREPL native agent loaded
Stopping thread "nREPL-session-9d0f6b25-8b0d-4549-b52f-9982a215bb35" using JVMTI...
A question: if I run nrepl manually in terminal and use cider-connect
, I should manually specify -J-Djdk.attach.allowAttachSelf
, right?
I guess so, just've tried and got the following message in the REPL:
user> (while true)
ERROR: Cannot stop thread on JDK20+ without jdk.attach.allowAttachSelf enabled.
user>