-
-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cider locks up Emacs regularly after cider-connect #1758
Comments
You'll get a backtrace you can paste here. |
This is from when it was locking up immediately after the Cider REPL prompt buffer prompt showed up after
|
This may be a long shot, but could you disable ido-ubiquitous and smex and try again? |
I'm using the exact same versions of all (except I'm on Linux) and experience the same symptoms. Try: I've run Emacs' profiler and this is what I found:
Seems like So, for me, disabling nrepl logging ( |
Interesting. @mrrodriguez do you use workgroup? |
I do not use workgroup. I tried I also tried disabling I think the hanging may be a little less when emacs has just been started. It seems that over time, things gradually get slower and lock up more often. |
@mrrodriguez I'd suggest to run the profiler, it's really easy:
I hope this helps. |
@dobladez thanks for the advice. This has helped me get some more information I believe.
I'm posting here to see if this is useful to anyone on the issue. |
Thanks for all the info @mrrodriguez. Looks like it's the dynamic-font-lock feature. If that's the case, I'll have to see how we can optimize that stuff. It's going to be hard though, given that most of the work seems to be spent on |
@Malabarba I set That is unfortunate that this seems to bottom-out on What am I losing by now having |
I do wonder why only some people are experiencing those lockups, though. Guess it has to do with the size of the buffers you're working with. |
@Malabarba Will you be able to take a look at this? It's pretty much the only thing I'd like us to fix before rolling out the new version. |
@mrrodriguez Yes. What you lose by disabling it is that the color won't update. You only have the static font-locking that has always been available in I don't think I'll have time to look at this for now, but we can leave it open. The oportunities for optimization seem to be the following:
|
OK, thanks for the update! |
Just a heads-up that Since upgrading to 0.12.0, Cider had become mostly unusable for me. Initial performance was significantly slower than before, and would continue to deteriorate until I'd eventually reboot Emacs after an hour or two of use. Even managed to get Emacs to entirely lock up OSX a few times, had to do a hard power-off. Disabling I'll note that I work with some particularly large projects; seems likely that that may be a contributing factor? |
I don't have time to debug/profile this myself right now and @Malabarba is also busy. Maybe we should just disable it by default for the next release? |
I guess so. =/ |
I'd like to try this. Not sure if I'll get anywhere before the release however. I'll ask you guys if I need any help :-) |
I have struggled in this problem a few weeks ; now I have known why I have this problem . I am new to emacs , so I download purcell's emacs config ; I suspect this config result in this problem , because Today I change to prelude's emacs config , I completely have not this problem . hope this will help . |
Hmm, that's interesting. Prelude definitely doesn't disable dynamic font-locking... Perhaps you experienced some other problem? |
yes ; the error fly check is off ;the dynamic promoting function is off. |
I was having this problem for a long time, maybe 4 or 5 months, but didn't get time to investigate it until a week or so ago, despite how painful it was. The problem is exactly as described by @mrrodriguez above. I was working with largish projects (>50 ns, >5000 LOC etc). Anyway -- setting
This is Emacs 24.5.1 on Debian unstable. |
@amoe thank you! This made my day. I am also working on a large codebase (upwards of 35k LOC, I am embarrassed to admit) and this freeze was so annoying. Can confirm,
|
I can disable this by default, but it would still be useful if you can share some evaluation that causes this so we can debug it. There's always some overhead from the logging, but it shouldn't be huge... |
Here's a giant backtrace from the first hang after https://gist.github.com/amoe/6164e9bd6cb2b0db7b05e6ef193e1d6b |
@amoe Looks like the culprit (at least in your case) is fci. That package is seems to be advising |
Indeed - the stacktrace clearly indicates the error doesn't happen in CIDER itself. |
In case it helps, I tried to use
Although I typed Then I tried There's another time it would hang, which is after running Both hangs (on Hope this is helpful. I'm happy to run any other commands that could be useful toward tracking this down as well. |
That's very helpful indeed. According to the profile data the nREPL message logging is super slow, which is probably something to be expected for big requests/responses. |
The log seriously degrades the overall CIDER performance. Until we manage to optimize the logging logic it's best to disable it by default.
I've disabled the message logging by default in light of the performance issue and I'll file a separate issue about it. |
On a related note how many of you are having performance issues with the dynamic font-locking functionality? |
I mentioned at #1758 (comment) that disabling dynamic font locking is what fixed the locking issues for me. So I would say that was where my problem was coming from. |
Yeah, I saw this - but it seems most people here had issues with the nrepl-log, not with the dynamic font-locking. That's why I asked. :-) |
It's odd to me that I didn't have to do anything with logging to fix it. Just the dynamic font locking. Perhaps just different issues that are environment dependent. |
Those who reported hang on logging, did you notice what was the message that caused the hang? What middleware could cause a massive log during startup? For the record, this is a programatic way to invoke the profiler for testing the logger: (benchmark-run 1
(let ((nrepl-log-messages t))
(profiler-start 'cpu)
(dotimes (i 500)
;; (cider-sync-request:inspect-expr "10" (cider-current-ns) "32")
;; (cider-eldoc-info "take")
(nrepl-sync-request:describe (cider-current-connection)))
(profiler-report)
(profiler-stop))) |
Regarding middleware, in my case I am running the nrepl server with: (clojure.tools.nrepl.server/start-server
:bind "0.0.0.0"
:port p
:handler (-> cider.nrepl/cider-nrepl-handler
(refactor-nrepl.middleware/wrap-refactor))) Regarding |
Guess we can close this ticket now. |
Expected behavior
When using cider-connect to connect to a pre-existing nREPL server, I expect it to connect and be responsive once the prompt is available. As I continue to interact and work in the REPL I do not expect frequent lock-ups that lock up Emacs itself, not only the REPL prompt.
Actual behavior
I use cider-connect to connect to a pre-existing nREPL server. I get a prompt fairly quickly with something like
However, if I try to type any character, Emacs/Cider becomes fully locked up. This lasts for anywhere from 5-10 seconds. Once it becomes responsive again, some characters I typed during the lock-up typically show up. Then I can start requiring my namespaces etc. This all happens at normal speeds at this point. However, frequently as I am doing more work in the editor with this connection present, I get frequent lock-ups again that lock the whole editor. I do not know what it is doing during this time.
Steps to reproduce the problem
My steps above are all you need to do to see this problem.
Environment & Version information
CIDER version information
Note: I see the same behavior in Java 6 as well.
Lein/Boot version
Emacs version
Operating system
The text was updated successfully, but these errors were encountered: