Skip to content

Commit

Permalink
Don't use logging in signal handler
Browse files Browse the repository at this point in the history
  • Loading branch information
omoerbeek committed Feb 7, 2025
1 parent 56cdb4f commit 17b0f36
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pdns/recursordist/rec_channel_rec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,10 @@ void doExitGeneric(bool nicely)
#if defined(__SANITIZE_THREAD__)
_exit(0); // regression test check for exit 0
#endif
g_slog->withName("runtime")->info(Logr::Notice, "Exiting on user request");
// Not safe from a signal handler!
// g_slog->withName("runtime")->info(Logr::Notice, "Exiting on user request")
static const string msg("Exiting on user request\n");
(void)write(STDERR_FILENO, msg.data(), msg.size());

if (!g_pidfname.empty()) {
unlink(g_pidfname.c_str()); // we can at least try..
Expand Down

0 comments on commit 17b0f36

Please sign in to comment.