Using inf-clojure-eval-buffer stucks the repl
Using Emacs the repl sometimes gets stuck when using inf-clojure-eval-buffer. This is new behaviour since the recent update to Unity 2018.
I'm using Emacs 25.3.3 on a Macbook Air (early 2014) on (non-High) Sierra. I also use the hotfix described here: https://github.com/arcadia-unity/Arcadia/issues/131#issuecomment-385166305 I've tried both 500kb and 2500kb with no difference in behaviour.
Steps to reproduce:
- Start an Arcadia project.
- Open
Assets/Arcadia/Source/arcadia/repl.clj(other files works as well, but it has to be a certain size I think). - Run
inf-clojure-eval-buffer. - After a while it gets stuck (on
#'arcadia.repl/start-serverfor me), then you can just write anything in the repl and press enter, and it will finish executing.
Yeah, sometimes the repl gets a little gummed up until you press enter or eval something. Definitely a bug, but endurable for now, so this probably won't be prioritized for a little while.
Okay, cool. I found that inf...-load-file never gets stuck, so there's a working alternative as well. :)
Den mån 27 aug. 2018 22:42Tims Gardner [email protected] skrev:
Yeah, sometimes the repl gets a little gummed up until you press enter or eval something. Definitely a bug, but endurable for now, so this probably won't be prioritized for a little while.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/arcadia-unity/Arcadia/issues/292#issuecomment-416361710, or mute the thread https://github.com/notifications/unsubscribe-auth/ACXPZ672AvXGSSLqNSh7tuRYZxplteFuks5uVFm1gaJpZM4V5fYK .
Yeah, sometimes the repl gets a little gummed up until you press enter or eval something.
This happens here pretty much every new session right after running inf-clojure-eval-buffer on the typical cannonical core.clj for a project. So I typically evaluate (+ 1 1).
So pretty much what Saikyun said :)
Used wireshark today to observe network traffic resulting from use of inf-clojure-eval-buffer.
It seems clear from the captured traffic that nothing has been received beyond what is showing up in emacs.
FWIW, pressing enter alone doesn't appear to cause additional things to arrive. However, a single '1' followed by enter does.
IIUC, inf-clojure-load-file works by arranging for a file to be loaded by sending something along the lines of:
(load-file ".../game/core.clj")
This typically doesn't result in much output -- may be that is of some relevance to this issue? I guess there is another difference in that the size of what is sent is also significantly smaller.
Perhaps it is obvious, but for the sake of clarity :)
Tried some further experiments with printing debug output and tracing.
It seems that when the "stuck" state is in effect, arcadia.internal.socket-repl/data-available? is returning false, even though there is more to process.
For reference, I came across the following possibly related info:
https://stackoverflow.com/questions/4261365/tcpclient-getstream-dataavailable-returns-false-but-stream-has-more-data
It seems possible that #288 is related.
Yeah, if you want something to compare to it works as intended when you use the standard read-function (I believe I've said that before... :P). Good find on the data-available? issue.
I tried sending some text via inf-clojure that caused the "stuck" state via telnet to port 37220. The result was no "stuck" state. Perhaps the whitespace issue with inf-clojure mentioned in #288 is a factor in this issue too.