Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ name: CI
on:
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request.
pull_request:
# Allow manual triggering from the Actions tab.
workflow_dispatch:
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push.
push:
branches:
- develop
- master
- 'release/**'
- 'feature/**'
- 'fix/**'
tags-ignore:
- '**'

Expand Down
4 changes: 4 additions & 0 deletions src/test/util/setup_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ BasicTestingSetup::BasicTestingSetup(const ChainType chainType, const std::vecto
SeedInsecureRand();
if (G_TEST_LOG_FUN) LogInstance().PushBackCallback(G_TEST_LOG_FUN);
InitLogging(*m_node.args);
// Apply -debug and -loglevel args (these are not processed by InitLogging,
// which only sets log options like timestamps/file paths).
(void)init::SetLoggingCategories(*m_node.args);
(void)init::SetLoggingLevel(*m_node.args);
AppInitParameterInteraction(*m_node.args);
LogInstance().StartLogging();
m_node.kernel = std::make_unique<kernel::Context>();
Expand Down
4 changes: 4 additions & 0 deletions src/util/fs_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <cerrno>
#include <filesystem>
#include <fstream>
#include <limits>
#include <map>
#include <memory>
#include <string>
Expand Down Expand Up @@ -186,6 +187,9 @@ int RaiseFileDescriptorLimit(int nMinFD)
setrlimit(RLIMIT_NOFILE, &limitFD);
getrlimit(RLIMIT_NOFILE, &limitFD);
}
// Clamp to INT_MAX to avoid overflow when rlim_cur is RLIM_INFINITY
if (limitFD.rlim_cur > (rlim_t)std::numeric_limits<int>::max())
return std::numeric_limits<int>::max();
return limitFD.rlim_cur;
}
return nMinFD; // getrlimit failed, assume it's fine
Expand Down
4 changes: 4 additions & 0 deletions src/util/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

#include <algorithm>
#include <cassert>
#include <limits>
#include <fcntl.h>
#include <sched.h>
#include <sys/resource.h>
Expand Down Expand Up @@ -1155,6 +1156,9 @@ int RaiseFileDescriptorLimit(int nMinFD) {
setrlimit(RLIMIT_NOFILE, &limitFD);
getrlimit(RLIMIT_NOFILE, &limitFD);
}
// Clamp to INT_MAX to avoid overflow when rlim_cur is RLIM_INFINITY
if (limitFD.rlim_cur > (rlim_t)std::numeric_limits<int>::max())
return std::numeric_limits<int>::max();
return limitFD.rlim_cur;
}
return nMinFD; // getrlimit failed, assume it's fine
Expand Down
Loading