Skip to content

Add lifecycle management to LocatorFactoryBean to control Locator start and stop [DATAGEODE-361] #408

Open
@spring-projects-issues

Description

@spring-projects-issues

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 the Locator 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions