Description
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:
-
Assuming we have an analogous issue with Gradle, though haven't tried
-
Tests - I wondered if we can accept a quit while running a long-running test. It seems like we can.
-
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.
-
I wonder what happens if Another thing to try bootstrap.properties