When executing the gfsh > shutdown --include-locators=true command , the internal shutdown function dispatches the shutdown function to data nodes as an asynchronous operation and returns within milliseconds, immediately proceeding to shut down the locators while cache servers are still mid-close.
As a result, the cluster immediately proceeds to shut down the locators while the cache servers are still mid-close and attempting to drain their queues.
Indefinite Hangs: Removing locators prematurely leaves cache servers unable to record clean departures from the membership network, which can trigger "stuck thread" or deadlocks and leave cache servers running as zombie processes.
Network Churn: Cache servers trying to contact already-departed locators generate extensive Connection refused logs and continuous reconnect-retry loops.
Data Instability: Forcing manual termination on hung nodes bypasses proper cluster exit checkpoints, increasing the risk of data inconsistency or DiskStoreException issues upon subsequent restarts.
Versions Affected:
A known product defect exists in the cluster shutdown sequencing. When a cluster-wide shutdown is initiated, via gfsh > shutdown --include-locators=true, a race condition can cause the Locators to terminate instantly while cache servers are still flushing data queues or gateway senders to disk.
During member departure, GemFire iterates through a list of waiting components to deliver departure notifications.
The Flaw: If any single component in that iteration sequence reports that it is already mid-close or shutting down, GemFire's walk terminates prematurely.
The Impact: Any components positioned after that point in the walk fail to receive the necessary release signal. Because GemFire does not enforce a time limit on this specific wait condition, affected cache servers will experience an indefinite hang ("stuck threads") and become unresponsive zombie processes until manually terminated.
This defect requires at least two cache servers to be closing concurrently. Large-scale environments with numerous persistent partitioned regions or multiple gateway-sender queues expand the notification walk list significantly, drastically increasing the statistical probability of triggering this early-termination flaw.
To prevent cluster hangs and stuck threads during shutdown on affected versions, do not use a single cluster-wide shutdown command. Instead, enforce a strict, sequential shutdown procedure:
gfsh> shutdown --time-out=600 --include-locators=falseVerify Process Termination: Actively monitor host operating systems (using jps or ps) to verify that all cache server JVM processes have completely terminated.
Shut Down Locators Last: Once you are 100% certain no cache servers remain running, issue the final command to stop the locators:
gfsh> shutdown --time-out=600 --include-locators=trueNote for Highly Vulnerable Environments: If your cluster continues to experience deadlocks due to multiple cache servers closing simultaneously, script the shutdown to loop over cache servers individually (stop one member, wait/poll until it fully departs, then move to the next) before proceeding to stop the locators.
This issue is tracked via GEM-19504. Fixes are scheduled to be available in the following upcoming releases: