Closed danielsz closed 4 years ago
I haven't seen this before. Is this printed to System/out or a log?
How long is "a long time"? Minutes? Hours?
Does this happen after the response is printed?
Is this over an SSH tunnel or something similar?
Does this happen if you use a different client, like REPL-y, and then disconnect?
System/out which gets logged by runit.
Minutes, two or three.
The operation is effectful and would return nil in a local repl. The exception occurs over the remote connection after the operation completes successfully and no response is printed.
The underlying transport is a Wireguard connection to a private IP.
If I attach REPL-y
to the remote host:port, I can navigate to the namespace where the operation is defined, execute the operation, see the return value (nil) after around two minutes, and disconnect without seeing the exception that I see with rep
.
Thank you!
The exception is definitely indicating that the connection is broken before some kind of output is printed. I can't duplicate it here.
I tried to simulate writing console output after close with:
/tmp/foo.clj:
(let [out *out*
f (fn []
(try
(binding [*out* out]
(Thread/sleep 200)
(println "text")
(.flush *out*)
(spit "/tmp/ok.txt" "ok"))
(catch Throwable e
(spit "/tmp/error.txt" (pr-str e)))))]
(.start (Thread. f)))
rep "$(cat /tmp/foo.clj)"
No luck... no error.
It's possible that some nREPL middleware is messing up the order of messages so that the output is being sent directly after the "done" message. It's not something rep
can really work around if so... It has no other way to detect the transaction is done.
Thank you, Jason. I'll let you know if anything new comes up.
First things first, awesome tool, thank you for sharing this. It's very useful.
I'm sending a command to a remote repl that takes a long time to complete. The client (
rep
) doesn't complain, but the nrepl server reports aSocketException: Socket closed
after the operation completes. Any idea how to handle this properly? Thank you.Note: Short operations do not display that behavior.
Stack error in full: