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 b29cb4ca82a4f05ea7dc0eadc330a64fbe685ef0 Author: Tim Armstrong <tarmstr...@cloudera.com> AuthorDate: Fri Jul 24 13:09:08 2020 -0700 IMPALA-10006: handle non-writable /opt/impala/logs The shutdown script should not abort if it can't write a log - it should continue to try and shut down impala. The entrypoint script should abort with an explicit error if the log directory isn't writable by the current user. Change-Id: If32d6eef75422b51f8877478bbfb1a709c02f756 Reviewed-on: http://gerrit.cloudera.org:8080/16237 Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Reviewed-by: Attila Jeges <atti...@cloudera.com> Reviewed-by: Andrew Sherman <asher...@cloudera.com> --- bin/graceful_shutdown_backends.sh | 4 +++- docker/daemon_entrypoint.sh | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/graceful_shutdown_backends.sh b/bin/graceful_shutdown_backends.sh index 833954e..495918b 100755 --- a/bin/graceful_shutdown_backends.sh +++ b/bin/graceful_shutdown_backends.sh @@ -27,7 +27,9 @@ export IMPALA_HOME=${IMPALA_HOME:-"/opt/impala"} LOG_FILE="$IMPALA_HOME/logs/shutdown.log" function LOG() { - echo $* | tee -a $LOG_FILE + # IMPALA-10006: append to LOG_FILE if possible, but don't fail if the log file isn't + # writable. + echo $* | tee -a $LOG_FILE || true } # Default grace timeout is the same as the default for Impala (-shutdown_grace_period_s), diff --git a/docker/daemon_entrypoint.sh b/docker/daemon_entrypoint.sh index c9d749b..f253296 100755 --- a/docker/daemon_entrypoint.sh +++ b/docker/daemon_entrypoint.sh @@ -56,6 +56,13 @@ if ! whoami ; then cat /etc/passwd fi +# IMPALA-10006: avoid cryptic failures if log dir isn't writable. +LOG_DIR=$IMPALA_HOME/logs +if [[ ! -w "$LOG_DIR" ]]; then + echo "$LOG_DIR is not writable" + exit 1 +fi + # Set ulimit core file size 0. ulimit -c 0