Skip to content

Drop other idle servers on exit #8610

@eed3si9n

Description

@eed3si9n

steps

  1. start an sbt session in one directory using sbt 2.x (defaults to sbtn), and exit
  2. start another sbt session in another directory using sbt 2.x and exit
  3. etc

problem

Each session leaves behind an idle server for 7 days.

serverIdleTimeout := Some(new FiniteDuration(7, TimeUnit.DAYS)),

expectation

  1. When sbt server starts up a port file active.json is created. Create another file 1234.json under $HOME/Library/Caches/sbt/v2/proc (the disk cache location for the OS + /proc) with the same content, where 1234 is the process id.
  2. Upon exit send dropIfIdle message to other servers. Remove 2345.json if it's unreachable.
  3. The servers that received dropIfIdle message should shut itself down, if it's been idle for 600 seconds or more.
  4. When the port file active.json is deleted, also delete 1234.json.
  5. This should reduce the idle server to one.

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