You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ar...@apache.org on 2019/02/07 21:48:45 UTC
[impala] 03/03: IMPALA-8171: minicluster: use exec builtin to start
Impala daemons
This is an automated email from the ASF dual-hosted git repository.
arodoni pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit 2fad3d08dd6d6c4ebc27f56d8a03e637a65fd29c
Author: Michael Brown <mi...@apache.org>
AuthorDate: Wed Feb 6 19:25:27 2019 -0800
IMPALA-8171: minicluster: use exec builtin to start Impala daemons
In IMPALA-7779 bin/start-daemon.sh was written to unify the place where
Impala daemons are started. It had a side-effect of keeping itself alive
as a parent process of the actual daemon. This broke the
tests.comparison.cluster abstraction used by the stress test and others
in that the process detection logic was finding false positives.
The old bin/start-*.sh scripts used the exec builtin to call their
daemons. Resurrect this as a simple fix; it also makes the ps list
shorter. Add a system test to catch this in the future.
Change-Id: I34ac8ce964f0c56287cee01360a4ba889f9568d7
Reviewed-on: http://gerrit.cloudera.org:8080/12391
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
bin/start-daemon.sh | 2 +-
tests/infra/test_stress_infra.py | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/bin/start-daemon.sh b/bin/start-daemon.sh
index 9df3934..721bf06 100755
--- a/bin/start-daemon.sh
+++ b/bin/start-daemon.sh
@@ -30,4 +30,4 @@ fi
. ${IMPALA_HOME}/bin/set-classpath.sh
# LLVM must be on path to symbolise sanitiser stack traces.
export PATH="${IMPALA_TOOLCHAIN}/llvm-${IMPALA_LLVM_VERSION}/bin:${PATH}"
-"$@"
+exec "$@"
diff --git a/tests/infra/test_stress_infra.py b/tests/infra/test_stress_infra.py
index 853fee5..a11116f 100644
--- a/tests/infra/test_stress_infra.py
+++ b/tests/infra/test_stress_infra.py
@@ -24,10 +24,12 @@ import pytest
from decimal import Decimal
from tests.common.impala_test_suite import ImpalaTestSuite
+from tests.comparison.cluster import MiniCluster
from tests.util.parse_util import (
EXPECTED_TPCDS_QUERIES_COUNT, EXPECTED_TPCH_NESTED_QUERIES_COUNT,
EXPECTED_TPCH_QUERIES_COUNT, match_memory_estimate)
from tests.util.test_file_parser import load_tpc_queries
+from tests.util.filesystem_utils import IS_LOCAL
class TestStressInfra(ImpalaTestSuite):
@@ -59,3 +61,14 @@ class TestStressInfra(ImpalaTestSuite):
assert count == len(queries)
for name in queries:
assert name is not None
+
+ def tests_minicluster_obj(self):
+ """
+ Test that the minicluster abstraction finds the minicluster.
+ """
+ cluster = MiniCluster()
+ if IS_LOCAL:
+ expected_pids = 1
+ else:
+ expected_pids = 3
+ assert expected_pids == len(cluster.impala.for_each_impalad(lambda i: i.find_pid()))