Skip to content

[2.x] hang when trying to start a new server subprocess #8442

@dleblanc

Description

@dleblanc

steps

Using SBT 2.0.0-RC8, if I start the server interactively (sbt --server), and then I run the "sbt" command separately (as a client), I can interact with the system as normal.

If I don't have a running server and I run "sbt", it tries to fork a server, but that seems to hang - it never creates the project/target/active.json file that the client is polling for.

Snooping on the command, it appears to run:
SBT_TERMINAL_PROPS="0,0,false,false,false" sbt -Dsbt.io.virtual=true --detach-stdio --server

While the client is hanging waiting for the launched server to run, if I run the above command in a separate window, that does create the active.json file, and the client connects to it normally.

Oddly enough, if I run "sbt --debug" - it seems to start and connect to the server just fine.

Also note that this only happens on Linux, this project loads fine on Mac OS (Java 17, Apple M2 silicon).

problem

It seems like when the SBT server is forked on Linux in this manner, that it hangs for some reason. If we start it manually, or even launch sbt with the "--debug" flag, it works normally. Perhaps the input handling isn't quite right.

expectation

That the forked sbt server would start, and we would use SBT normally (as it does when passed the --debug flag).

notes

This is on Ubuntu 24.04, Java OpenJDK 17.0.17. SBT installed via "cs" on the stable channel. Using SBT 2.0.0-RC8 (also seen in RC7).

If I use strace to examine what the server process is doing, it's just looping on a bunch of futex calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions