impala-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tarmstr...@apache.org
Subject [37/50] incubator-impala git commit: Update python impala cluster script for docker compatibility
Date Tue, 12 Apr 2016 21:19:11 GMT
Update python impala cluster script for docker compatibility

The python scripts looked at all processes even those not owned by the
current user which includes docker processes. The fix is to only
consider processes owned by the current user.

Some unused imports were also removed.

Change-Id: I8ae7c4a5f3c6ce7d2838f9f722d5341c585cf562
Reviewed-on: http://gerrit.cloudera.org:8080/1629
Reviewed-by: Casey Ching <casey@cloudera.com>
Tested-by: Internal Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/8311f5e3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/8311f5e3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/8311f5e3

Branch: refs/heads/master
Commit: 8311f5e30afd29598e733f500406a8de9eaace3b
Parents: e956a6b
Author: casey <casey@cloudera.com>
Authored: Sun Dec 13 20:39:18 2015 -0800
Committer: Tim Armstrong <tarmstrong@cloudera.com>
Committed: Tue Apr 12 14:03:43 2016 -0700

----------------------------------------------------------------------
 tests/common/impala_cluster.py | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/8311f5e3/tests/common/impala_cluster.py
----------------------------------------------------------------------
diff --git a/tests/common/impala_cluster.py b/tests/common/impala_cluster.py
index 6fbc0f1..4aac17c 100644
--- a/tests/common/impala_cluster.py
+++ b/tests/common/impala_cluster.py
@@ -14,20 +14,15 @@
 #
 # Basic object model of an Impala cluster (set of Impala processes).
 #
-import json
 import logging
-import os
 import psutil
 import socket
-import sys
-import urllib
 
-from collections import defaultdict
-from HTMLParser import HTMLParser
-from random import choice, shuffle
+from getpass import getuser
+from random import choice
 from tests.common.impala_service import *
 from tests.util.shell_util import exec_process_async, exec_process
-from time import sleep, time
+from time import sleep
 
 logging.basicConfig(level=logging.ERROR, format='%(threadName)s: %(message)s')
 LOG = logging.getLogger('impala_cluster')
@@ -97,7 +92,6 @@ class ImpalaCluster(object):
     impalads = list()
     statestored = list()
     catalogd = None
-    # TODO: Consider using process_iter() here
     for pid in psutil.get_pid_list():
       try:
         process = psutil.Process(pid)
@@ -105,6 +99,13 @@ class ImpalaCluster(object):
         # A process from get_pid_list() no longer exists, continue.
         LOG.info(e)
         continue
+      try:
+        if process.username != getuser():
+          continue
+      except KeyError, e:
+        if "uid not found" in str(e):
+          continue
+        raise
       if process.name == 'impalad' and len(process.cmdline) >= 1:
         impalads.append(ImpaladProcess(process.cmdline))
       elif process.name == 'statestored' and len(process.cmdline) >= 1:


Mime
View raw message