Internal Jenkins has submitted this change and it was merged.

Change subject: IMPALA-3433: Simplify global destructors
......................................................................


IMPALA-3433: Simplify global destructors

This patch aims to simplify process teardown by reducing the work that
global destructors do and avoid potential delays and exceptions that
could leave the process in a weird state.

Don't try to tear down periodic counter thread: it will be terminated
anyway and can cause delays in tearing down the process.

Use a SpinLock instead of mutexes for global locks. Boost mutexes have a
destructor that invalidates the lock, which can cause races if other
threads try to lock or unlock the lock.

Based on some limited testing, this speeds up process shutdown greatly
and avoids exceptions being thrown. On a run before this patch, process
shutdown frequently took 100+ seconds. After this patch, it completed
consistently in < 1s.

Change-Id: I2cc3a4c53811f6a18c2a6010c3541ca149e5672c
Reviewed-on: http://gerrit.cloudera.org:8080/2892
Reviewed-by: Dan Hecht <[email protected]>
Tested-by: Internal Jenkins
---
M be/src/exec/hdfs-lzo-text-scanner.cc
M be/src/exec/hdfs-lzo-text-scanner.h
M be/src/runtime/mem-tracker.cc
M be/src/runtime/mem-tracker.h
M be/src/util/periodic-counter-updater.cc
M be/src/util/periodic-counter-updater.h
6 files changed, 20 insertions(+), 27 deletions(-)

Approvals:
  Internal Jenkins: Verified
  Dan Hecht: Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2cc3a4c53811f6a18c2a6010c3541ca149e5672c
Gerrit-PatchSet: 2
Gerrit-Project: Impala
Gerrit-Branch: cdh5-trunk
Gerrit-Owner: Tim Armstrong <[email protected]>
Gerrit-Reviewer: Dan Hecht <[email protected]>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Tim Armstrong <[email protected]>

Reply via email to