You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2021/04/30 23:51:21 UTC

[impala] 02/03: IMPALA-10471: Making deadline for Shutdown by SIGRTMIN configurable

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

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 87384e3377ee25f56a16573cf8493c19b4578258
Author: Amogh Margoor <am...@cloudera.com>
AuthorDate: Tue Apr 13 22:44:21 2021 +0100

    IMPALA-10471: Making deadline for Shutdown by SIGRTMIN configurable
    
    Making deadline for Shutdown caused by SIGRTMIN configurable
    using flag: shutdown_deadline_s. The deadline for shutdown
    by SIGRTMIN was fixed to 1 year and was independent of the
    flag earlier. This patch ensures even this shutdown behaviour
    is governed by the common flag: shutdown_deadline_s.
    
    TESTING:
     1. Modified existing test to reflect the configurable deadline.
     2. Verified manually
     3. Ran the cluster tests (which include test_restart_services)
    
    Change-Id: I52cb1ba76e7ce9de86ceb2f84389b1ab257e4c05
    Reviewed-on: http://gerrit.cloudera.org:8080/17348
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/common/init.cc                         | 3 +--
 tests/custom_cluster/test_restart_services.py | 7 +++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/be/src/common/init.cc b/be/src/common/init.cc
index 3b67247..a5cfbc8 100644
--- a/be/src/common/init.cc
+++ b/be/src/common/init.cc
@@ -191,8 +191,7 @@ extern "C" { void __gcov_flush(); }
     CHECK(err == 0) << "sigwait(): " << GetStrErrMsg(err) << ": " << err;
     CHECK_EQ(IMPALA_SHUTDOWN_SIGNAL, signal);
     ShutdownStatusPB shutdown_status;
-    const int ONE_YEAR_IN_SECONDS = 365 * 24 * 60 * 60;
-    Status status = impala_server->StartShutdown(ONE_YEAR_IN_SECONDS, &shutdown_status);
+    Status status = impala_server->StartShutdown(-1, &shutdown_status);
     if (!status.ok()) {
       LOG(ERROR) << "Shutdown signal received but unable to initiate shutdown. Status: "
                  << status.GetDetail();
diff --git a/tests/custom_cluster/test_restart_services.py b/tests/custom_cluster/test_restart_services.py
index 4115ef0..771c686 100644
--- a/tests/custom_cluster/test_restart_services.py
+++ b/tests/custom_cluster/test_restart_services.py
@@ -577,8 +577,10 @@ class TestGracefulShutdown(CustomClusterTestSuite, HS2TestSuite):
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(
       impalad_args="--shutdown_grace_period_s={grace_period} \
+          --shutdown_deadline_s={deadline} \
           --hostname={hostname}".format(grace_period=IDLE_SHUTDOWN_GRACE_PERIOD_S,
-            hostname=socket.gethostname()), cluster_size=1)
+            deadline=EXEC_SHUTDOWN_DEADLINE_S, hostname=socket.gethostname()),
+      cluster_size=1)
   def test_shutdown_signal(self):
     """Test that an idle impalad shuts down in a timely manner after the shutdown grace
     period elapses."""
@@ -597,7 +599,8 @@ class TestGracefulShutdown(CustomClusterTestSuite, HS2TestSuite):
     # Make sure signal was received and the grace period and deadline are as expected.
     self.assert_impalad_log_contains('INFO',
       "Shutdown signal received. Current Shutdown Status: shutdown grace period left: "
-      "{0}s000ms, deadline left: 8760h".format(self.IDLE_SHUTDOWN_GRACE_PERIOD_S))
+      "{0}s000ms, deadline left: {1}s000ms".format(self.IDLE_SHUTDOWN_GRACE_PERIOD_S,
+        self.EXEC_SHUTDOWN_DEADLINE_S))
 
   @pytest.mark.execute_serially
   @CustomClusterTestSuite.with_args(cluster_size=1)