tindzk / seed

Build tool for Scala projects
https://tindzk.github.io/seed/
Apache License 2.0
238 stars 13 forks source link

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

Open hohonuuli opened 4 years ago

hohonuuli commented 4 years ago

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

tindzk commented 4 years ago

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 commented 3 years ago

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