You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by je...@apache.org on 2018/01/29 14:11:08 UTC

[geode] branch develop updated: GEODE-4374: Allow client calls to complete before shutting down (#1354)

This is an automated email from the ASF dual-hosted git repository.

jensdeppe 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 dd24cb9  GEODE-4374: Allow client calls to complete before shutting down (#1354)
dd24cb9 is described below

commit dd24cb9f70af6e242d6f33d223ed69fa9e53c08b
Author: Jens Deppe <jd...@pivotal.io>
AuthorDate: Mon Jan 29 06:11:01 2018 -0800

    GEODE-4374: Allow client calls to complete before shutting down (#1354)
    
    - This adds a small delay in the async shutdown function so that any client
      responses can be sent. This avoids client getting some form of disconnect
      exception during shutdown.
---
 .../geode/management/internal/cli/functions/ShutDownFunction.java   | 6 ++++++
 .../internal/cli/commands/ShutdownCommandOverHttpDUnitTest.java     | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ShutDownFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ShutDownFunction.java
index 4fb8605..c3b01e7 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ShutDownFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ShutDownFunction.java
@@ -72,6 +72,12 @@ public class ShutDownFunction implements Function, InternalEntity {
       throws InterruptedException, ExecutionException {
     ExecutorService exec = Executors.newSingleThreadExecutor();
     Future future = exec.submit(() -> {
+      try {
+        // Allow the function call to exit so we don't get disconnect exceptions in the client
+        // making the call.
+        Thread.sleep(1000);
+      } catch (InterruptedException ignore) {
+      }
       ConnectionTable.threadWantsSharedResources();
       if (ids.isConnected()) {
         ids.disconnect();
diff --git a/geode-web/src/test/java/org/apache/geode/management/internal/cli/commands/ShutdownCommandOverHttpDUnitTest.java b/geode-web/src/test/java/org/apache/geode/management/internal/cli/commands/ShutdownCommandOverHttpDUnitTest.java
index 5634afb..6627c89 100644
--- a/geode-web/src/test/java/org/apache/geode/management/internal/cli/commands/ShutdownCommandOverHttpDUnitTest.java
+++ b/geode-web/src/test/java/org/apache/geode/management/internal/cli/commands/ShutdownCommandOverHttpDUnitTest.java
@@ -21,7 +21,7 @@ import org.apache.geode.test.junit.categories.DistributedTest;
 import org.apache.geode.test.junit.categories.FlakyTest;
 import org.apache.geode.test.junit.rules.GfshCommandRule;
 
-@Category({DistributedTest.class, FlakyTest.class})
+@Category(DistributedTest.class)
 public class ShutdownCommandOverHttpDUnitTest extends ShutdownCommandDUnitTest {
 
   @Override

-- 
To stop receiving notification emails like this one, please contact
jensdeppe@apache.org.