diff options
author | Tor Brede Vekterli <vekterli@vespa.ai> | 2024-04-10 12:23:31 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@vespa.ai> | 2024-04-10 12:55:41 +0000 |
commit | c70a40e4895b2657909ef3c38043a36b72b1036c (patch) | |
tree | dcb067b2a023b4910ba40d7bf8008af77ea3d2cc /storageserver | |
parent | 29b9803e6932ab9be36e97463219b7d09494857f (diff) |
Install Abseil failure signal handler in distributor/proton daemons
This will attempt to dump a stack trace for the offending thread
to stderr, which greatly improves visibility for everyone running
Vespa on systems with core dumps disabled.
Signal handler chaining is explicitly enabled to allow sanitizer
handlers to be called as expected.
Note that we install our own signal handlers _after_ the Abseil
handlers to avoid noisy stack dumping on `SIGTERM`. It is considered
a fatal signal by the failure handler, but the config sentinel
uses it as a friendly "please shutdown now, or else" nudge in the
common case.
Diffstat (limited to 'storageserver')
-rw-r--r-- | storageserver/src/apps/storaged/CMakeLists.txt | 1 | ||||
-rw-r--r-- | storageserver/src/apps/storaged/storage.cpp | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/storageserver/src/apps/storaged/CMakeLists.txt b/storageserver/src/apps/storaged/CMakeLists.txt index 67377c6cba3..25bf1ced552 100644 --- a/storageserver/src/apps/storaged/CMakeLists.txt +++ b/storageserver/src/apps/storaged/CMakeLists.txt @@ -8,6 +8,7 @@ vespa_add_executable(storageserver_storaged_app DEPENDS storageserver_storageapp protobuf::libprotobuf + absl::failure_signal_handler ) vespa_add_target_package_dependency(storageserver_storaged_app Protobuf) diff --git a/storageserver/src/apps/storaged/storage.cpp b/storageserver/src/apps/storaged/storage.cpp index fe3bf696e9a..cffc03a585b 100644 --- a/storageserver/src/apps/storaged/storage.cpp +++ b/storageserver/src/apps/storaged/storage.cpp @@ -21,6 +21,7 @@ #include <vespa/config/helper/configgetter.hpp> #include <vespa/vespalib/util/signalhandler.h> #include <google/protobuf/message_lite.h> +#include <absl/debugging/failure_signal_handler.h> #include <iostream> #include <csignal> #include <cstdlib> @@ -213,8 +214,15 @@ int StorageApp::main(int argc, char **argv) } // storage int main(int argc, char **argv) { + absl::FailureSignalHandlerOptions opts; + // See `searchcore/src/apps/proton/proton.cpp` for parameter and handler ordering rationale. + opts.call_previous_handler = true; + opts.use_alternate_stack = false; + absl::InstallFailureSignalHandler(opts); + vespalib::SignalHandler::PIPE.ignore(); vespalib::SignalHandler::enable_cross_thread_stack_tracing(); + storage::StorageApp app; storage::sigtramp = &app; int retval = app.main(argc,argv); |