This is an automated email from the ASF dual-hosted git repository.
mhanson pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 20844a8494 GEODE-10306 Fixing an order issue that can lead to problems
when stopping (#7682)
20844a8494 is described below
commit 20844a84947a746ec4c740acf5af6734bfb272c1
Author: mhansonp <[email protected]>
AuthorDate: Fri May 13 14:31:31 2022 -0700
GEODE-10306 Fixing an order issue that can lead to problems when stopping
(#7682)
When stopping the cache server, the acceptor is last which should not be
the case. It should be first so new data stops coming in.
---
.../geode/internal/cache/CacheServerImpl.java | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git
a/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerImpl.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerImpl.java
index c8f8b96033..25d6f70b33 100644
---
a/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerImpl.java
+++
b/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerImpl.java
@@ -460,6 +460,16 @@ public class CacheServerImpl extends AbstractCacheServer
implements Distribution
}
RuntimeException firstException = null;
+ try {
+ if (acceptor != null) {
+ acceptor.close();
+ }
+ } catch (RuntimeException e) {
+ logger.warn("CacheServer - Error closing acceptor monitor", e);
+ if (firstException != null) {
+ firstException = e;
+ }
+ }
try {
if (loadMonitor != null) {
@@ -479,16 +489,7 @@ public class CacheServerImpl extends AbstractCacheServer
implements Distribution
firstException = e;
}
- try {
- if (acceptor != null) {
- acceptor.close();
- }
- } catch (RuntimeException e) {
- logger.warn("CacheServer - Error closing acceptor monitor", e);
- if (firstException != null) {
- firstException = e;
- }
- }
+
if (firstException != null) {
throw firstException;