Internal Jenkins has submitted this change and it was merged.

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
Reviewed-on: http://gerrit.cloudera.org:8080/2364
Reviewed-by: Michael Ho <[email protected]>
Tested-by: Internal Jenkins
---
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(-)

Approvals:
  Michael Ho: Looks good to me, approved
  Internal Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/2364
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I00a43a69512c07eb351cf13bd1353226719744ca
Gerrit-PatchSet: 3
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Michael Ho <[email protected]>
Gerrit-Reviewer: Dan Hecht <[email protected]>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Michael Ho <[email protected]>
Gerrit-Reviewer: Skye Wanderman-Milne <[email protected]>

Reply via email to