From 576426ab68aea1f2668330be7ab7110702be823c Mon Sep 17 00:00:00 2001 From: Nicolae Vartolomei Date: Sat, 4 May 2024 22:48:46 +0100 Subject: [PATCH] reactor: print scheduling group along with backtrace Backtraces are printed in at least 2 cases: 1) during segfaults, 2) during reactor stalls. Extra context is always helpful in identifying the exact circumstances during which the above happen. E.g. in a server application where user requests are processed in one (or more) scheduling group(s), background processes are split between different scheduling groups as well, knowing the scheduling group narrows the search space. Ref https://github.com/scylladb/seastar/issues/2216 --- src/core/reactor.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/reactor.cc b/src/core/reactor.cc index e1250cc119f..c9bfaf99caf 100644 --- a/src/core/reactor.cc +++ b/src/core/reactor.cc @@ -143,6 +143,7 @@ module seastar; #include #include #include +#include #include #include #include @@ -850,6 +851,9 @@ static void print_with_backtrace(backtrace_buffer& buf, bool oneline) noexcept { buf.append_decimal(this_shard_id()); } + buf.append(", in scheduling group "); + buf.append(current_scheduling_group().name().c_str()); + if (!oneline) { buf.append(".\nBacktrace:\n"); buf.append_backtrace();