Skip to content

Dev mode should listen for a 'q' keyboard input at an earlier point in the startup sequence, and stop Liberty server if needed #1638

Open
@scottkurz

Description

@scottkurz

In Liberty Tools Eclipse we are using an Eclipse-managed Terminal instance to drive dev mode... so we rely on our plugin issuing keyboard cmds via this terminal. To quit dev mode we send a 'q' or 'Exit' command via this terminal.

On Windows we have the particular problem that the ShutdownHook doesn't seem to get control when a terminal window is closed...either inside the Eclipse IDE or outside (in my experience).

So in the case where dev mode has completed startup, Liberty Tools can issue the 'Exit' command itself, resulting in a full cleanup (including stop of the server).

However, we are unable to issue this command while dev mode is still starting up. If we happen to attempt cleanup just after dev mode has started the Liberty server, but before it is accepting keyboard input, then the Liberty server will remain started (orphaned), and interfere with the next attempt to start.

So the main purpose for raising this issue is that we want to ensure the Liberty server is ultimately stopped.

RELATED USE CASES

Nothing below is too profound but things to think about perhaps while working on and testing any fix:

  1. Assuming we have an analogous issue with Gradle, though haven't tried

  2. Tests - I wondered if we can accept a quit while running a long-running test. It seems like we can.

  3. Dev mode server restart - If one edits bootstrap.properties dev mode will initiate a server restart. It seems like the quit functions well in that use case.

  4. I wonder what happens if Another thing to try bootstrap.properties

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