From 21a9cd3714fabc734179a24331b059fb23eec7c5 Mon Sep 17 00:00:00 2001 From: Prasanna Loganathar Date: Mon, 30 May 2022 19:32:43 +0530 Subject: [PATCH] Minor cleanups, log fds --- src/scheduler.cpp | 9 --------- src/util/system.cpp | 3 +++ src/util/threadnames.cpp | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/scheduler.cpp b/src/scheduler.cpp index e949234629..8c8473bf14 100644 --- a/src/scheduler.cpp +++ b/src/scheduler.cpp @@ -51,14 +51,6 @@ void CScheduler::serviceQueue() // Wait until either there is a new task, or until // the time of the first item on the queue: - -// wait_until needs boost 1.50 or later; older versions have timed_wait: -#if BOOST_VERSION < 105000 - while (!shouldStop() && !taskQueue.empty() && - newTaskScheduled.timed_wait(lock, toPosixTime(taskQueue.begin()->first))) { - // Keep waiting until timeout - } -#else // Some boost versions have a conflicting overload of wait_until that returns void. // Explicitly use a template here to avoid hitting that overload. while (!shouldStop() && !taskQueue.empty()) { @@ -66,7 +58,6 @@ void CScheduler::serviceQueue() if (newTaskScheduled.wait_until<>(lock, timeToWaitFor) == boost::cv_status::timeout) break; // Exit loop after timeout, it means we reached the time of the event } -#endif // If there are multiple threads, the queue can empty while we're waiting (another // thread may service the task we were waiting on). if (shouldStop() || taskQueue.empty()) diff --git a/src/util/system.cpp b/src/util/system.cpp index ffafb762c3..7b41378e53 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -1058,8 +1058,11 @@ int RaiseFileDescriptorLimit(int nMinFD) { setrlimit(RLIMIT_NOFILE, &limitFD); getrlimit(RLIMIT_NOFILE, &limitFD); } + LogPrintf("conf: fd limit: req: %d, set %d, max: %d\n", + nMinFD, limitFD.rlim_cur, limitFD.rlim_max); return limitFD.rlim_cur; } + LogPrintf("conf: fd limit: %d, max: unknown\n", nMinFD); return nMinFD; // getrlimit failed, assume it's fine #endif } diff --git a/src/util/threadnames.cpp b/src/util/threadnames.cpp index 07b18d8597..a641ba1b08 100644 --- a/src/util/threadnames.cpp +++ b/src/util/threadnames.cpp @@ -57,6 +57,6 @@ static void SetInternalName(std::string name) { } void util::ThreadRename(std::string&& name) { - SetThreadName(("defi-" + name).c_str()); + SetThreadName(("defid-" + name).c_str()); SetInternalName(std::move(name)); }