From c70a40e4895b2657909ef3c38043a36b72b1036c Mon Sep 17 00:00:00 2001 From: Tor Brede Vekterli Date: Wed, 10 Apr 2024 12:23:31 +0000 Subject: 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. --- storageserver/src/apps/storaged/storage.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'storageserver/src/apps/storaged/storage.cpp') 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 #include #include +#include #include #include #include @@ -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); -- cgit v1.2.3