Skip to content

Commit ec75b36

Browse files
committed
crimson/common/fatal_signal: Log error before collecting backtrace
Signed-off-by: Matan Breizman <[email protected]>
1 parent 5c738ba commit ec75b36

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/crimson/common/fatal_signal.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ void FatalSignal::install_oneshot_signal_handler()
9595
// about e.g. sigreturn(2) calling; see the man page).
9696
constexpr std::size_t FRAMES_TO_SKIP = 2 + 1;
9797

98+
// Let's inform regarding the abort before getting the stacktrace
99+
std::string pre_backtrace = fmt::format(
100+
"Aborting {} on shard {} - Stopping all shards",
101+
cause,
102+
seastar::engine_is_ready() ? std::to_string(seastar::this_shard_id()) : "no shard");
103+
104+
GENERIC_ERROR("{}", pre_backtrace);
105+
std::cerr << pre_backtrace << std::flush;
106+
107+
seastar::engine().exit(1);
108+
98109
std::string backtrace = fmt::format("{} on shard {} \nBacktrace:\n {}",
99110
cause,
100111
seastar::engine_is_ready() ? std::to_string(seastar::this_shard_id()) : "no shard",

0 commit comments

Comments
 (0)