This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-04-15
Channels
- # announcements (1)
- # babashka (21)
- # beginners (23)
- # biff (8)
- # boot (1)
- # cider (4)
- # clerk (21)
- # clj-kondo (31)
- # clojure (60)
- # clojure-brasil (5)
- # clojure-europe (20)
- # clojurescript (21)
- # datomic (14)
- # graalvm (10)
- # honeysql (1)
- # hoplon (4)
- # hyperfiddle (42)
- # introduce-yourself (1)
- # leiningen (1)
- # lsp (53)
- # pathom (4)
- # releases (2)
- # scittle (24)
- # shadow-cljs (3)
- # xtdb (4)
Heyo! I have been having an issue that has been plaguing me for a while and I am trying to figure out how to debug it further. Occasionally when evaluating an expression that throws an exception I get an issue where my nrepl session becomes unresponsive. My JVM still works (eg. I see log messages, web server responds, etc). but nrepl related functionality (eg. documentation) doesn't work. Turning on nrepl-log-messages
reveals that requests are being sent but no replies are received. The first request that doesn't get a response is as follows:
(-->
id "628"
op "analyze-last-stacktrace"
session "231fae66-f907-4c94-b033-13baba6f9c96"
time-stamp "2023-04-15 14:05:20.094831744"
nrepl.middleware.print/buffer-size 4096
nrepl.middleware.print/options (dict ...)
nrepl.middleware.print/print "cider.nrepl.pprint/pprint"
nrepl.middleware.print/quota 1048576
nrepl.middleware.print/stream? "1"
)
Anything that I can do to help debug this further? Unfortunately it's very inconsistent (ie. only 20% of exceptions cause this to happen, and it's inconsistent as to whether the same exception will do it... So perhaps its a race case?). As you can imagine, it's pretty disruptive to flow to have to completely restart the repl session when debugging an error.Looking at the code for: https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/stacktrace.clj#L36
(defn- handle-analyze-last-stacktrace-op
"Handle the analyze last stacktrace op."
[{:keys [session] :as msg}]
(if (and session (@session #'*e))
(analyze-last-stacktrace msg)
(no-error msg))
(done msg))
I'm wondering if an exception being thrown in either analyze-last-stacktrace
or no-error
could cause the nrepl server to become unresponsive if (done msg)
is never called.analyze-last-stacktrace
is a relatively new addition so it's possible that it has some corner case.
I'd suggest creating an issue and cc/ing the author of https://github.com/clojure-emacs/haystack
Thanks for the suggested, created an issue on the GitHub: https://github.com/clojure-emacs/cider-nrepl/issues/771