This is an automated email from the ASF dual-hosted git repository. aonishuk pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push: new a4af8ed AMBARI-24560. Better debugging for agent start failure due to stuck fuser call (aonishuk) a4af8ed is described below commit a4af8ed297a00b367f5948941b6cd92943d00b13 Author: Andrew Onishuk <aonis...@hortonworks.com> AuthorDate: Wed Aug 29 13:39:07 2018 +0300 AMBARI-24560. Better debugging for agent start failure due to stuck fuser call (aonishuk) --- ambari-agent/src/main/python/ambari_agent/PingPortListener.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ambari-agent/src/main/python/ambari_agent/PingPortListener.py b/ambari-agent/src/main/python/ambari_agent/PingPortListener.py index d2eca78..e701c52 100644 --- a/ambari-agent/src/main/python/ambari_agent/PingPortListener.py +++ b/ambari-agent/src/main/python/ambari_agent/PingPortListener.py @@ -25,7 +25,7 @@ import socket from ambari_commons import subprocess32 logger = logging.getLogger(__name__) -FUSER_CMD = "fuser {0}/tcp 2>/dev/null | awk '{1}'" +FUSER_CMD = "timeout 10 fuser {0}/tcp 2>/dev/null | awk '{1}'" PSPF_CMD = "ps -fp {0}" PORT_IN_USE_MESSAGE = "Could not open port {0} because port already used by another process:\n{1}" @@ -38,6 +38,9 @@ class PingPortListener(threading.Thread): self.config = config self.host = '0.0.0.0' self.port = int(self.config.get('agent','ping_port')) + + logger.debug("Checking Ping port listener port {0}".format(self.port)) + if not self.port == None and not self.port == 0: (stdoutdata, stderrdata) = self.run_os_command_in_shell(FUSER_CMD.format(str(self.port), "{print $1}")) if stdoutdata.strip() and stdoutdata.strip().isdigit():