summaryrefslogtreecommitdiff
path: root/src/mongo/util/signal_handlers.cpp
diff options
context:
space:
mode:
authorBen Caimano <ben.caimano@10gen.com>2020-05-18 19:07:01 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-01 19:46:53 +0000
commit75d1f23bce29496631a3e8cc2b9161698141afb4 (patch)
treed3963ace2a87c5143a5f537d0b799348b87f4492 /src/mongo/util/signal_handlers.cpp
parent7f491a6b9f16fca3b919e2d185bdcba09dcb58e2 (diff)
downloadmongo-75d1f23bce29496631a3e8cc2b9161698141afb4.tar.gz
SERVER-48022 Cleanup infrastructure log lines in mongo/util
Diffstat (limited to 'src/mongo/util/signal_handlers.cpp')
-rw-r--r--src/mongo/util/signal_handlers.cpp53
1 files changed, 29 insertions, 24 deletions
diff --git a/src/mongo/util/signal_handlers.cpp b/src/mongo/util/signal_handlers.cpp
index 7634e0bd473..94e399d2f82 100644
--- a/src/mongo/util/signal_handlers.cpp
+++ b/src/mongo/util/signal_handlers.cpp
@@ -80,8 +80,9 @@ namespace {
void consoleTerminate(const char* controlCodeName) {
setThreadName("consoleTerminate");
LOGV2(23371,
- "got {controlCodeName}, will terminate after current cmd ends",
- "controlCodeName"_attr = controlCodeName);
+ "Received event {controlCode}, will terminate after current command ends",
+ "Received event, will terminate after current command ends",
+ "controlCode"_attr = controlCodeName);
exitCleanly(EXIT_KILL);
}
@@ -122,8 +123,9 @@ void eventProcessingThread() {
HANDLE event = CreateEventA(nullptr, TRUE, FALSE, eventName.c_str());
if (event == nullptr) {
LOGV2_WARNING(23382,
- "eventProcessingThread CreateEvent failed: {errnoWithDescription}",
- "errnoWithDescription"_attr = errnoWithDescription());
+ "eventProcessingThread CreateEvent failed: {error}",
+ "eventProcessingThread CreateEvent failed",
+ "error"_attr = errnoWithDescription());
return;
}
@@ -132,17 +134,16 @@ void eventProcessingThread() {
int returnCode = WaitForSingleObject(event, INFINITE);
if (returnCode != WAIT_OBJECT_0) {
if (returnCode == WAIT_FAILED) {
- LOGV2_WARNING(
- 23383,
- "eventProcessingThread WaitForSingleObject failed: {errnoWithDescription}",
- "errnoWithDescription"_attr = errnoWithDescription());
+ LOGV2_WARNING(23383,
+ "eventProcessingThread WaitForSingleObject failed: {error}",
+ "eventProcessingThread WaitForSingleObject failed",
+ "error"_attr = errnoWithDescription());
return;
} else {
LOGV2_WARNING(23384,
- "eventProcessingThread WaitForSingleObject failed: "
- "{errnoWithDescription_returnCode}",
- "errnoWithDescription_returnCode"_attr =
- errnoWithDescription(returnCode));
+ "eventProcessingThread WaitForSingleObject failed: {error}",
+ "eventProcessingThread WaitForSingleObject failed",
+ "error"_attr = errnoWithDescription(returnCode));
return;
}
}
@@ -180,8 +181,9 @@ bool waitForSignal(const sigset_t& sigset, SignalWaitResult* result) {
if (errsv == EINTR)
continue;
LOGV2_FATAL_CONTINUE(23385,
- "sigwaitinfo failed with error:{strerror_errsv}",
- "strerror_errsv"_attr = strerror(errsv));
+ "sigwaitinfo failed with error: {error}",
+ "sigwaitinfo failed with error",
+ "error"_attr = strerror(errsv));
return false;
}
return true;
@@ -202,24 +204,26 @@ struct LogRotationState {
void handleOneSignal(const SignalWaitResult& waited, LogRotationState* rotation) {
int sig = waited.sig;
LOGV2(23377,
- "got signal {sig} ({strsignal_sig})",
- "sig"_attr = sig,
- "strsignal_sig"_attr = strsignal(sig));
+ "Received signal {signal}: {error}",
+ "Received signal",
+ "signal"_attr = sig,
+ "error"_attr = strsignal(sig));
#if defined(__linux__)
const siginfo_t& si = waited.si;
switch (si.si_code) {
case SI_USER:
case SI_QUEUE:
LOGV2(23378,
- "kill from pid:{si_si_pid} uid:{si_si_uid}",
- "si_si_pid"_attr = si.si_pid,
- "si_si_uid"_attr = si.si_uid);
+ "Signal was sent by kill(2) with pid {pid}, uid {uid}",
+ "Signal was sent by kill(2)",
+ "pid"_attr = si.si_pid,
+ "uid"_attr = si.si_uid);
break;
case SI_TKILL:
- LOGV2(23379, "tgkill");
+ LOGV2(23379, "Signal was sent by tgkill(2)");
break;
case SI_KERNEL:
- LOGV2(23380, "kernel");
+ LOGV2(23380, "Signal was sent by the kernel");
break;
}
#endif // __linux__
@@ -280,8 +284,9 @@ void signalProcessingThread(LogFileStatus rotate) {
if (int r = pthread_sigmask(SIG_SETMASK, &waitSignals, nullptr); r != 0) {
int errsv = errno;
LOGV2_FATAL(31377,
- "pthread_sigmask failed with error:{strerror_errsv}",
- "strerror_errsv"_attr = strerror(errsv));
+ "pthread_sigmask failed with error: {error}",
+ "pthread_sigmask failed with error",
+ "error"_attr = strerror(errsv));
}
#if defined(MONGO_STACKTRACE_CAN_DUMP_ALL_THREADS)