bloop icon indicating copy to clipboard operation
bloop copied to clipboard

Unexpected large program outputs freaks out the server

Open marcinzh opened this issue 5 years ago • 4 comments

Using sbt, installed bloop with curl.

(1 to 100000).foreach(i => println(s"Hello world #${i}"))
bloop run helloworld

Never fully completes: after several 10.000s of lines printed, either quits with "Server unexpectedly disconnected in recv_into()", or silently freezes.

When run from within sbt, program completes successfully.

marcinzh avatar Apr 21 '20 13:04 marcinzh

Thanks for reporting @marcinzh, this is a good catch! I ran into this issue lately as well. In my case, I got a similar error, but the server never froze. I wonder if our new bloop CLI (bloopgun) will handle this case correctly.

jvican avatar Apr 22 '20 10:04 jvican

Hi @jvican, I thought this might be related:

scala.io.StdIn.readLine()

When run with bloop, it never completes. Just keeps swallowing input forever, including newlines.

marcinzh avatar Apr 22 '20 12:04 marcinzh

This is an independent issue, I think there’s an open ticket for it. In this particular ticket, I think there’s something going on with the way we’re sending output from the server and reading it from the client.

jvican avatar Apr 22 '20 12:04 jvican

Seems like we get a ConnectionReset for some reason:

 Unexpected error forces client exit!
java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:210)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at java.io.DataInputStream.read(DataInputStream.java:149)
	at snailgun.protocol.Protocol.readPayload$1(Protocol.scala:169)
	at snailgun.protocol.Protocol.$anonfun$processChunkFromServer$1(Protocol.scala:187)
	at scala.util.Try$.apply(Try.scala:213)
	at snailgun.protocol.Protocol.processChunkFromServer(Protocol.scala:180)
	at snailgun.protocol.Protocol.sendCommand(Protocol.scala:108)
	at snailgun.TcpClient.run(TcpClient.scala:34)
	at bloop.bloopgun.BloopgunCli.executeCmd$1(Bloopgun.scala:268)
	at bloop.bloopgun.BloopgunCli.fireCommand(Bloopgun.scala:274)
	at bloop.bloopgun.BloopgunCli.run(Bloopgun.scala:230)
	at bloop.bloopgun.Bloopgun$.main(Bloopgun.scala:638)
	at bloop.bloopgun.Bloopgun.main(Bloopgun.scala)

jvican avatar May 08 '20 19:05 jvican