From 9548a664610ed7953b882186040fb5674546610d Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 9 Jan 2023 13:19:28 +0100 Subject: [PATCH] Name recursor threads consistently with a "rec/" prefix. Use thread names without capitals, as they look a bit ugly otherwise. Threads started by libfstrm are not named, as they are created internally by the lib. Partly supsersedes #11138 --- pdns/recursordist/nod.cc | 4 ++-- pdns/recursordist/rec-main.cc | 4 ++-- pdns/recursordist/rpzloader.cc | 2 +- pdns/remote_logger.cc | 2 +- pdns/snmp-agent.cc | 2 +- pdns/webserver.cc | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pdns/recursordist/nod.cc b/pdns/recursordist/nod.cc index fd16679d31..9c41df5907 100644 --- a/pdns/recursordist/nod.cc +++ b/pdns/recursordist/nod.cc @@ -193,7 +193,7 @@ bool PersistentSBF::snapshotCurrent(std::thread::id tid) void NODDB::housekeepingThread(std::thread::id tid) { - setThreadName("pdns-r/NOD-hk"); + setThreadName("rec/nod-hk"); for (;;) { sleep(d_snapshot_interval); { @@ -263,7 +263,7 @@ void UniqueResponseDB::addResponse(const std::string& response) void UniqueResponseDB::housekeepingThread(std::thread::id tid) { - setThreadName("pdns-r/UDR-hk"); + setThreadName("rec/udr-hk"); for (;;) { sleep(d_snapshot_interval); { diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index 18f6c8eb95..ad0cb39fd5 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -224,7 +224,7 @@ int RecThreadInfo::runThreads(Logr::log_t log) handlerInfo.start(0, "web+stat", cpusMap, log); auto& taskInfo = RecThreadInfo::info(2); taskInfo.setTaskThread(); - taskInfo.start(2, "taskThread", cpusMap, log); + taskInfo.start(2, "task", cpusMap, log); auto& info = RecThreadInfo::info(currentThreadId); info.setListener(); @@ -278,7 +278,7 @@ int RecThreadInfo::runThreads(Logr::log_t log) for (unsigned int n = 0; n < RecThreadInfo::numTaskThreads(); ++n) { auto& info = RecThreadInfo::info(currentThreadId); - info.start(currentThreadId++, "taskThread", cpusMap, log); + info.start(currentThreadId++, "task", cpusMap, log); } /* This thread handles the web server, carbon, statistics and the control channel */ diff --git a/pdns/recursordist/rpzloader.cc b/pdns/recursordist/rpzloader.cc index df83ce07ac..16008f3b46 100644 --- a/pdns/recursordist/rpzloader.cc +++ b/pdns/recursordist/rpzloader.cc @@ -383,7 +383,7 @@ static bool dumpZoneToDisk(Logr::log_t logger, const DNSName& zoneName, const st void RPZIXFRTracker(const std::vector& primaries, const boost::optional& defpol, bool defpolOverrideLocal, uint32_t maxTTL, size_t zoneIdx, const TSIGTriplet& tt, size_t maxReceivedBytes, const ComboAddress& localAddress, const uint16_t xfrTimeout, const uint32_t refreshFromConf, std::shared_ptr sr, const std::string& dumpZoneFileName, uint64_t configGeneration) { - setThreadName("pdns-r/RPZIXFR"); + setThreadName("rec/rpzixfr"); bool isPreloaded = sr != nullptr; auto luaconfsLocal = g_luaconfs.getLocal(); diff --git a/pdns/remote_logger.cc b/pdns/remote_logger.cc index e9e2efe39d..94a8a94a8b 100644 --- a/pdns/remote_logger.cc +++ b/pdns/remote_logger.cc @@ -191,7 +191,7 @@ void RemoteLogger::maintenanceThread() { try { #ifdef WE_ARE_RECURSOR - string threadName = "pdns-r/remLog"; + string threadName = "rec/remlog"; #else string threadName = "dnsdist/remLog"; #endif diff --git a/pdns/snmp-agent.cc b/pdns/snmp-agent.cc index 4b2bc6b027..f00bf6d6c9 100644 --- a/pdns/snmp-agent.cc +++ b/pdns/snmp-agent.cc @@ -107,7 +107,7 @@ void SNMPAgent::worker() } #ifdef RECURSOR - string threadName = "pdns-r/SNMP"; + string threadName = "rec/snmp"; #else string threadName = "dnsdist/SNMP"; #endif diff --git a/pdns/webserver.cc b/pdns/webserver.cc index 874e7cfac6..f6f540789d 100644 --- a/pdns/webserver.cc +++ b/pdns/webserver.cc @@ -237,7 +237,7 @@ void WebServer::registerWebHandler(const string& url, const HandlerFunction& han } static void *WebServerConnectionThreadStart(const WebServer* webServer, std::shared_ptr client) { - setThreadName("pdns-r/webhndlr"); + setThreadName("rec/webhndlr"); const std::string msg = "Exception while serving a connection in main webserver thread"; try { webServer->serveConnection(client); -- 2.47.2