-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugger breaks on quit when debugging function called via http #689
Comments
I can add that pressing |
Even if fix is not easy, a workaround would be very useful. If for example, there's a function to call that would reset debugger state? It takes quite a long time for our system to restart, and killing the repl and restarting everything is the only way I know to get the debugger working again once this state is hit. |
@bbatsov any idea how to work around this? The debugger essentially broken for all of us that work on webapps. If anyone else sees this and is looking for an alternative, I've reverted to using the updated clj-commons version of spyscope. I also use these convenience functions to add/remove the reader macro: (defun toggle-spy (p)
(interactive "P")
(if current-prefix-arg
(unspy)
(insert "#spy/d "))
(cider-eval-defun-at-point))
(defun unspy ()
(save-excursion
(let ((start (progn (cljr--goto-toplevel) (point)))
(end (progn (paredit-forward) (point))))
(replace-regexp "#spy/d " "" nil start end)))) |
It might be something to do with this |
@expez workaround: making sure to press |
Looking at the session metadata in the source it doesn't seem like it has a
I guess one of you can play with this to check if this is the problem. |
Here's a guess on what's happening based on some debugging. I think the reason for this behavior with HTTP handlers is the The same behavior with HTTP handlers can be observed with This is not a problem with normal functions in debug mode because each new invocation of that function starts with a new context bindings. So each new call to debuggable function starts with But in case of a HTTP handler, the web context is persistent. For e.g this works, even if you (defn test-debugger
[]
(println "*skip-break*: " @cider.nrepl.middleware.debug/*skip-breaks*)
(let [a (rand-int 1000)
b (rand-int 2000)]
(str "Random generated: " (* a b)))
(swap! cider.nrepl.middleware.debug/*skip-breaks* (constantly nil))) |
Expected behavior
Pressing q (for quit) when debugging a function called indirectly via http should quit the debugger without causing future issues.
Actual behavior
Pressing q (for quit) when debugging a function called indirectly via http causes an error:
Execution error (NullPointerException) at cider.nrepl.middleware.debug/abort! (debug.clj:143)
After this error occurs, all future attempts to invoke the debugger fail silently.
Steps to reproduce the problem
git clone https://github.com/danielneal/cider-debugger-issue
cider-jack-in
cider-debug-defun-at-point
with the point in the body of thehandler
function.start-server
command in thecomment
block.http/get
command in thecomment
block.Environment & Version information
cider-nrepl version
0.25.5
Java version
1.8
Operating system
Mac OS X 10.15.7 Catalina
The text was updated successfully, but these errors were encountered: