Skip to content

Commit

Permalink
GEODE-10306 Fixing an order issue that can lead to problems when stop…
Browse files Browse the repository at this point in the history
…ping (apache#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.
  • Loading branch information
mhansonp authored May 13, 2022
1 parent 602f99c commit 20844a8
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,16 @@ public synchronized void stop() {
}

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) {
Expand All @@ -479,16 +489,7 @@ public synchronized void stop() {
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;
Expand Down

0 comments on commit 20844a8

Please sign in to comment.