Add lifecycle management to LocatorFactoryBean to control Locator start and stop [DATAGEODE-361] #408
Labels
in: api
Issues with API
in: configuration
Issues with configuration
in: infrastructure
Environment issues
type: enhancement
A general enhancement
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 aLocator
instance successfully, but then fall straight through, causing the JVM to exit (with exit code 0).This improvement will couple the
Locator
instancestart
andstop
operations with Spring's Lifecycle management capabilities using theLifecycle
, or alternatively theSmartLifecycle
interface.Technically, this means the
LocatorLaucher.start()
andLocatorLauncher.waitOnLocator()
methods will be called inLifecycle.start()
andLocatorLauncher.stop()
will be called inLifecycle.stop()
, while the (perceived) construction of theLocator
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
The text was updated successfully, but these errors were encountered: