You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@impala.apache.org by "Michael Ho (Code Review)" <ge...@cloudera.org> on 2016/03/01 03:11:54 UTC

[Impala-CR](cdh5-trunk) IMPALA-3068: Don't call exit(1) on fatal errors.

Michael Ho has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/2364

Change subject: IMPALA-3068: Don't call exit(1) on fatal errors.
......................................................................

IMPALA-3068: Don't call exit(1) on fatal errors.

When hitting certain fatal errors, Impalad may call exit(1) directly
or indirectly via macro like EXIT_WITH_ERROR() to exit Impalad.
Usually, there are error messages logged before exit(1) is called but
they may not have been flushed to the log file before exit occurs. In
addition, exit(1) may trigger destruction of some global variables
(e.g. static_mem_trackers_lock_) which can cause other threads to
crash and core dump, potentially masking the original error.

This change converts places in the code which call exit(1) to use
LOG(FATAL) instead. LOG(FATAL) will call abort() instead of exit(1),
so destructors won't be called on global variables. In addition,
it will flush all logs before calling abort(). This is essentially
the path the code takes when a DCHECK is triggered.

This change also installs a "fatal error handler" for LLVM. It's
invoked right before LLVM calls exit(1) when it hits a "fatal error".
This hopefully helps capture some useful trace in the log in the rare
case LLVM hits any "fatal error".

Change-Id: I00a43a69512c07eb351cf13bd1353226719744ca
---
M be/src/codegen/llvm-codegen.cc
M be/src/common/status.h
M be/src/scheduling/request-pool-service.cc
M be/src/service/impala-server.cc
M be/src/util/jni-util.h
5 files changed, 24 insertions(+), 47 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala refs/changes/64/2364/1
-- 
To view, visit http://gerrit.cloudera.org:8080/2364
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I00a43a69512c07eb351cf13bd1353226719744ca
Gerrit-PatchSet: 1
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Michael Ho <kw...@cloudera.com>