Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log fd limits, minor cleanup #1310

Merged
merged 1 commit into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,13 @@ 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()) {
boost::chrono::system_clock::time_point timeToWaitFor = taskQueue.begin()->first;
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())
Expand Down
3 changes: 3 additions & 0 deletions src/util/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/threadnames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}