You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2019/03/20 05:07:43 UTC
[impala] 01/02: IMPALA-8320: Handle psutil error in tests
This is an automated email from the ASF dual-hosted git repository.
tarmstrong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit 3baf08ae3b8bf2bcf6d83a4a8b9259d12bbdad84
Author: Lars Volker <lv...@cloudera.com>
AuthorDate: Tue Mar 19 11:57:50 2019 -0700
IMPALA-8320: Handle psutil error in tests
We use psutil.Process.cmdline to access a process's command line. This
field is a property and tries to retrieve process information from the
OS. If the process has terminated in the meantime, such access will
result in an error which we need to handle. This change adds proper
error handling. I ran the existing Breakpad tests to make sure we don't
regress, but there's no obvious way to test that particular corner case
that would be worth the effort.
Change-Id: Ia5fec061f845d3deb6328e52e590a7a79196dfd4
Reviewed-on: http://gerrit.cloudera.org:8080/12792
Reviewed-by: Lars Volker <lv...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
tests/common/impala_cluster.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tests/common/impala_cluster.py b/tests/common/impala_cluster.py
index 1596741..996b640 100644
--- a/tests/common/impala_cluster.py
+++ b/tests/common/impala_cluster.py
@@ -206,7 +206,13 @@ class ImpalaCluster(object):
# empty for a brief moment, before it gets reaped by its parent (see man proc). We
# copy the cmdline to prevent it from changing between the following checks and
# the construction of the *Process objects.
- cmdline = process.cmdline
+ cmdline = ''
+ try:
+ cmdline = process.cmdline
+ except psutil.NoSuchProcess:
+ # IMPALA-8320: psutil.Process.cmdline is a property and the process could have
+ # disappeared between the time we built the process list and now.
+ continue
if len(cmdline) == 0:
continue
if process.name == 'impalad':