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 2019/12/28 02:17:40 UTC
[impala] 02/02: IMPALA-9241: Remove pid files on successful
shutdown of minicluster
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 fa7d91fd305bac2dc5c4a145528b6cc45f5972fe
Author: Joe McDonnell <jo...@cloudera.com>
AuthorDate: Thu Dec 26 12:21:50 2019 -0800
IMPALA-9241: Remove pid files on successful shutdown of minicluster
The minicluster init scripts currently keep track of pids
for HDFS, YARN, etc by writing the pid to files for each
service. It uses the pid in the file to see what is running and
needs to shutdown or start. Currently, it does not remove the pid
file after the minicluster shuts down. This means that it would
be reading a zombie pid from the pid file to see if the service
is already running. If the pid is reused by something else, it
can fail to start up a necessary service.
This removes the pid files when the minicluster components shut down
successfully.
Change-Id: I5b14d74df8061b6595b9897df9c9667e3f569e34
Reviewed-on: http://gerrit.cloudera.org:8080/14950
Reviewed-by: Andrew Sherman <as...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
testdata/cluster/node_templates/common/etc/init.d/common.tmpl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/testdata/cluster/node_templates/common/etc/init.d/common.tmpl b/testdata/cluster/node_templates/common/etc/init.d/common.tmpl
index 51197c5..525ffdb 100644
--- a/testdata/cluster/node_templates/common/etc/init.d/common.tmpl
+++ b/testdata/cluster/node_templates/common/etc/init.d/common.tmpl
@@ -80,6 +80,8 @@ function stop {
local DEADLINE=$(($(date +%s) + $TIMEOUT_SECS))
while [[ $(date +%s) -lt $DEADLINE ]]; do
if ! pid_exists $PID; then
+ # Remove the pid file so that there is no confusion if the pids wrap
+ rm -f $PID_FILE
return
fi
sleep 0.1