Skip to content
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

cider--error-phase-of-last-exception can call itself when the cider-nrepl middleware is faulty #3605

Closed
vemv opened this issue Jan 16, 2024 · 3 comments · Fixed by #3607
Closed
Assignees

Comments

@vemv
Copy link
Member

vemv commented Jan 16, 2024

One thing I've noticed with recent reports is that whenever the cider-nrepl analyze-stacktrace op was faulty, cider--error-phase-of-last-exception would enter into a recursion loop.

Worth investigating

@vemv vemv self-assigned this Jan 16, 2024
@bbatsov
Copy link
Member

bbatsov commented Jan 16, 2024

whenever the cider-nrepl analyze-stacktrace op was faulty

Faulty how?

@vemv
Copy link
Member Author

vemv commented Jan 16, 2024

For instance:

  • Running an older Clojure
  • Having 1M files in resources

(both cases are fixed by now)

Those two are unrelated but resulted in the same symptoms.

@vemv
Copy link
Member Author

vemv commented Jan 17, 2024

Can repro by:

  • Entering (/ 2 0) in the repl
    • Doesn't trigger the issue - it merely ensures that the mw is loaded.
  • modifying cider.nrepl.middleware.stacktrace/analyze-last-stacktrace to throw an exception like (/ 2 0)
  • evaling an expr, but not from the repl, but inline in a .clj buffer instead (cider-eval-sexp-at-point)

So this should be specific to its eval handler (there are a few eval handlers that call cider--error-phase-of-last-exception), namely cider-interactive-eval-handler.

This creates a loop that C-g can't exit, presumably because requests will keep happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants