Skip to content

Fix bug in Cache Data Export caused by Geode's JVM Shutdown Hook #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jxblum opened this issue Jun 8, 2020 · 2 comments
Closed

Fix bug in Cache Data Export caused by Geode's JVM Shutdown Hook #88

jxblum opened this issue Jun 8, 2020 · 2 comments
Assignees
Milestone

Comments

@jxblum
Copy link
Contributor

jxblum commented Jun 8, 2020

Apache Geode prematurely closes all cache objects and pulls the rug out from any application, framework and tool's feet.

Geode registers a JVM Shutdown Hook that closes all cache objects (e.g. Regions) before a framework, such as Spring, has an opportunity to perform resource clean up, such as in Spring Container Lifecycle callbacks, such as DisposableBean. This is potentially dangerous and definitely naive on Geode's part.

Fortunately, Geode uses a JVM System Property to control the registration of the JVM Shutdown Hook, and prevent the hook from prematurely closing the cache so that application/framework/tools have an opportunity to perform or resource release and clean up tasks that Geode unaware of.

@jxblum jxblum self-assigned this Jun 8, 2020
@jxblum jxblum added this to the 1.3.0.RELEASE milestone Jun 8, 2020
@jxblum
Copy link
Contributor Author

jxblum commented Jun 8, 2020

Argh!!!

Unfortunately, this (dumb) block of code requires Spring to somehow intercept or set the JVM System Property before Geode's InternalDistributedSystem class is loaded!

Currently exploring the feasibility of Spring Boot's AutoConfigureBefore annotation(s)...

@jxblum
Copy link
Contributor Author

jxblum commented Jun 8, 2020

This will need to be in something like a Spring Framework BeanFactoryPostProcessor, or more appropriately, a Spring Boot EnvironmentPostProcessor since this (Geode) JVM System Property needs to be set early (before a class load on InternalDistributedSystem which happens when the cache is created)!

jxblum added a commit to jxblum/spring-boot-data-geode that referenced this issue Jun 8, 2020
@jxblum jxblum added fixed and removed in-progress labels Jun 8, 2020
@jxblum jxblum closed this as completed in 288b6bb Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant