clojure-emacs / ac-nrepl

[DEPRECATED] Emacs auto-complete backend for nrepl completions
74 stars 11 forks source link

Hangs caching JVM class names #25

Open mjwillson opened 11 years ago

mjwillson commented 11 years ago

I've noticed lengthy slowdowns before while ac-nrepl is 'caching JVM class names', but recently found a show-stopper where this hangs indefinitely (I just left it overnight) after adding "(use 'clj-stacktrace.repl)" to :repl-options :init in my .lein/profiles.clj.

Not sure whether this is ac-nrepl's fault or clj-stacktraces (so I opened https://github.com/mmcgrana/clj-stacktrace/issues/18 too), but in general it might be good to put some kind of timeout or limits on this caching business, or do it in a separate thread (no idea if this is possible!) since it seems to block the emacs UI pretty severely with a killall emacs24 being the only way I found to interrupt it.

(If it's doing something recursive, perhaps it needs some recursion depth limit or cycle avoidance logic?)

purcell commented 11 years ago

Strange indeed. There's no recursion going on, and this step usually completes in just a few seconds, even with a pretty full classpath. When I get chance, I'll see if I can duplicate this, but I'm a bit snowed under right now. :-/

mjwillson commented 11 years ago

Huh, strange. Cheers for the input anyway. Let me know if there's anything I can do to instrument the code and see what's going on -- at present I have to restart emacs though.

purcell commented 11 years ago

Okay, so I added the clj-stacktrace snippet to my profiles.clj, and I still can't reproduce the error. Are you using the snippet currently described at https://github.com/mmcgrana/clj-stacktrace ? The version of that snippet for Lein 2.x doesn't include (use 'clj-stacktrace.repl), so maybe you need to update that in your profiles.clj?

-Steve

purcell commented 11 years ago

@mjwillson Can you confirm if that was the issue?

mjwillson commented 11 years ago

I'm using the injections snippet from those docs but also (use 'clj-stacktrace.repl), because I wanted to have the modified pst/print-stack-trace etc available from the REPL, but their snippet just re-binds it within the clojure.stracktrace namespace.

Apologies if this is a fiddly one to track down, I've disabled the snippet for now to get some work done, but if I get time I'll poke around a bit more. Perhaps it's a bug in complete.core, in fact, since it seems you're just calling through to that.

vemv commented 11 years ago

So I'm experiencing this issue too - emacs freezes when ac-nrepl tries to cache JVM names. I should note that I just upgraded from an old version emacs24 snapshot (the last one available for ubuntu 10.10) to a very recent one (that included with ubuntu 13.04 beta).

It only happens when using my complete emacs setup which uses a fair amount of plugins, config etc. With this absolute minimal setup for Clojure, the issue disappears.

@mjwillson, perhaps you'd be interested in trying to reproduce the issue using the minimal setup I provided (or an equivalent one) + your profiles.clj.

vemv commented 11 years ago

Using an emacs snapshot rather than the version provided by ubuntu 13.04 solved the issue for me.

purcell commented 11 years ago

I wanted to note here that it seems there was an auto-complete issue (auto-complete/auto-complete#153) which caused similar hanging issues with EDTS (an Erlang helper mode with a similar socket-based backend process): the related comments at the end of the EDTS README sound very familiar...

-Steve

MalloZup commented 5 years ago

autogenerated with https://github.com/MalloZup/doghub: issue inactive since 450 days. Please update the issue or close it