seed icon indicating copy to clipboard operation
seed copied to clipboard

Intermittent exception: `java.net.SocketException: Bad file descriptor`

Open hohonuuli opened this issue 4 years ago • 2 comments

When I run seed commands, they all seem to run and complete just fine but about every once in a while I get the following exception at the end of the command's execution:

Jun 22, 2020 6:44:04 PM org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor run
SEVERE: java.net.SocketException: Bad file descriptor
org.eclipse.lsp4j.jsonrpc.JsonRpcException: java.net.SocketException: Bad file descriptor
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:120)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:99)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.net.SocketException: Bad file descriptor
	at org.newsclub.net.unix.NativeUnixSocket.read(Native Method)
	at org.newsclub.net.unix.AFUNIXSocketImpl$AFUNIXInputStream.read(AFUNIXSocketImpl.java:312)
	at org.newsclub.net.unix.AFUNIXSocketImpl$AFUNIXInputStream.read(AFUNIXSocketImpl.java:319)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:79)
	... 6 more

I'm running on macOS 10.15.5

hohonuuli avatar Jun 23 '20 01:06 hohonuuli

I remember having seen similar stack traces in the past.

It looks as if the BSP server terminates prematurely without Seed expecting it. I have just tested a couple of commands (run --watch, run, link etc.), but could not reproduce the bug on Linux with Bloop 1.4.2.

tindzk avatar Jun 27 '20 12:06 tindzk

I can reproduce this bug locally and in Drone CI by running BloopIntegrationSpec. It still occurs even after upgrading to the latest Bloop version.

tindzk avatar Dec 10 '20 15:12 tindzk