diff options
author | Tor Brede Vekterli <vekterli@oath.com> | 2019-01-11 15:05:12 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@oath.com> | 2019-01-11 15:05:12 +0000 |
commit | 06718046727efbcd21a28362784fd89e3b40374b (patch) | |
tree | b8ca1c325ebecf331f451b1d08eb336e6d2e7e84 /searchlib | |
parent | bafc19bf1b7cf39b2c1293949de648b53ebd460c (diff) |
Always sleep for some seconds during SIGBUS handling
Gives the main thread a fair chance to send an informative error response
to the cluster controller. Also add a condition which ensures that the
state file is only written once even with multiple signals in flight.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/util/sigbushandler.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/searchlib/src/vespa/searchlib/util/sigbushandler.cpp b/searchlib/src/vespa/searchlib/util/sigbushandler.cpp index 9de3f16be67..7356baab131 100644 --- a/searchlib/src/vespa/searchlib/util/sigbushandler.cpp +++ b/searchlib/src/vespa/searchlib/util/sigbushandler.cpp @@ -97,7 +97,7 @@ SigBusHandler::handle(int sig, siginfo_t *si, void *ucv) do { // Protect against multiple threads. TryLockGuard guard; - if (!guard.gotLock()) { + if (!guard.gotLock() || _fired) { raced = true; break; } @@ -121,18 +121,19 @@ SigBusHandler::handle(int sig, siginfo_t *si, void *ucv) sleep(5); return; } - untrap(); // Further bus errors will trigger core dump if (_unwind != nullptr) { // Unit test is using siglongjmp based unwinding sigjmp_buf *unwind = _unwind; _unwind = nullptr; + untrap(); // Further bus errors will trigger core dump siglongjmp(*unwind, 1); } else { // Normal case, sleep 3 seconds (i.e. allow main thread to detect // issue and notify cluster controller) before returning and // likely core dumping. sleep(3); + untrap(); // Further bus errors will trigger core dump } } |