Hi Dharam-

I would recommend CTRL-C from the command-line, which just sends a INT
signal (equivalent to `kill -2`) to the JVM.

This is safe since both GemFire and the *Spring* container register JVM
shutdown hooks to shutdown/close any resources allocated (e.g. GemFire
cache) during application runtime.

In fact, the *Spring* container will register a JVM shutdown hook to
properly close the ApplicationContext, which in turn calls the destroy()
<http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/beans/factory/DisposableBean.html#destroy-->
[1]
lifecycle callback method on all DisposableBeans declared/registered in the
context.  All *Spring Data Geode* FactoryBeans responsible for creating
GemFire objects (i.e. Cache, Regions, DiskStores, Gateways, etc) are
DisposableBeans (e.g. RegionFactoryBean
<https://github.com/spring-projects/spring-data-geode/blob/master/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java#L96-L97>
[2]).
The corresponding destroy lifecycle callback method for each of the SDG
FactoryBean then attempts to destroy, or properly close the corresponding
GemFire object (e.g. RegionFactoryBean.destroy()
<https://github.com/spring-projects/spring-data-geode/blob/master/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java#L646-L671>
[3]),
sometimes with "configurable" behavior.

If you KILL hard (i.e. -9, or -KILL) the *Spring*/GemFire JVM process, then
you are not giving the JVM a chance to shutdown in a correct, orderly
fashion.

Hope this helps.

Regards,
John


[1]
http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/beans/factory/DisposableBean.html#destroy--
[2]
https://github.com/spring-projects/spring-data-geode/blob/master/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java#L96-L97
[3]
https://github.com/spring-projects/spring-data-geode/blob/master/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java#L646-L671


On Thu, Jul 6, 2017 at 10:27 AM, Dharam Thacker <[email protected]>
wrote:

> Hello Team,
>
> Is it a nice idea to stop server bootstrapped using spring boot and spring
> data geode using "kill -9"?
>
> Gfsh stop does not work currently for server bootstrapped using spring
> data geode.
>
> What's the recommended way? Can it corrupt system?
>
> Thanks,
> Dharam
>
>
>
>
>


-- 
-John
john.blum10101 (skype)

Reply via email to