Description
John Blum opened DATAGEODE-361 and commented
Currently, when users declare the @LocatorApplication
annotation on a Spring main class (e.g. a main class annotated with @SpringBootApplication
), Spring will configure and bootstrap a Locator
instance successfully, but then fall straight through, causing the JVM to exit (with exit code 0).
This improvement will couple the Locator
instance start
and stop
operations with Spring's Lifecycle management capabilities using the Lifecycle
, or alternatively the SmartLifecycle
interface.
Technically, this means the LocatorLaucher.start()
and LocatorLauncher.waitOnLocator()
methods will be called in Lifecycle.start()
and LocatorLauncher.stop()
will be called in Lifecycle.stop()
, while the (perceived) construction of the Locator
object representing the distribution locator and location services will occur after initialization, as before.
Additional attributes will be added to the @LocatorApplication
to control this behavior:
phase
- giving users precise control over when theLocator
will start and stop during the Spring container lifecycle.waitOnLocator
- allowing the Locator JVM process to be blocked waiting for the Locator be be stopped, which will be useful in production Use Cases.
Affects: 2.4 M1 (2020.0.0), 2.2.9 (Moore SR9), 2.3.2 (Neumann SR2)
Reference URL: https://stackoverflow.com/questions/63197753/locatorapplication-starts-and-then-immediately-stops