Calva: Calva REPL lags when evaluation throws an error

Created on 27 Dec 2020  ·  8Comments  ·  Source: BetterThanTomorrow/calva

When an evaluation in the Calva REPL throws an Exception it will take a couple of seconds (5 to 10 or so) to show the exception and return the prompt. E.g.

clj::user=> 
(/ 1 0)

Some seconds...

; Execution error (ArithmeticException) at user/eval21385 (REPL:21).
; Divide by zero

Tested with jack-in Clojure CLI (empty deps.edn), leiningen and Clojure CLI started in the a terminal window + connect

Visual Studio Code:
Version: 1.52.1
Commit: ea3859d4ba2f3e577a159bc91e3074c5d85c0523
Date: 2020-12-16T16:30:02.420Z (1 wk ago)
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 18.7.0

Calva:
Version: 2.0.138 and 2.0.134

bug

Most helpful comment

Yeah, the older version was fetching the data from ClojureDocs the first time someone used the info op. This was a big mistake for various reasons and we've later switched to just bundling a snapshot of the data with orchard.

All 8 comments

With the help of @zelark , I've found that switching off wifi makes the lag go away.

Also, after some experimentation, I think we can get rid of the problem by upgrading the cider-nrepl et al versions used for jack-in.

Wifi? :thinking: Very strange.

The n in nREPL does stand for ”network” which is why I then tried if upgrading those helped. Haha.

I just checked with Little Snitch to see what network connections are set up when an exception is thrown. I see connections being made to clojuredocs-edn.netlify.com and clojuredocs-edn.netlify.app. When I deny connections to both the REPL functions as expected. Disabling only one, will improve the response time of the REPL (subjectively at least).

Thanks, @julianwegkamp, that explains why this suddenly started to be a problem. @bbatsov mentioned something about a change in clojuredocs.

In any case, latest Calva, v2.0.140, bumps jack-in to latest cider-nrepl and that fixes the issue for us.

Now I'm really curious as to what library was retrieving info from those domains (if I understand correctly). I don't see anything about them in nrepl, cider-nrepl, orchard, or Calva.

Scratch that, I see orchard and cider-nrepl do things with clojuredocs. I'm guessing it was from one of those.

Yeah, the older version was fetching the data from ClojureDocs the first time someone used the info op. This was a big mistake for various reasons and we've later switched to just bundling a snapshot of the data with orchard.

Was this page helpful?
0 / 5 - 0 ratings