Compare commits

..

3 Commits

Author SHA1 Message Date
Valentin Balaschenko
70a05ec5fa message 2026-03-31 15:47:33 +01:00
Valentin Balaschenko
10f7b5c291 fix the job name 2026-03-31 15:43:10 +01:00
Valentin Balaschenko
5a3f61c99e removing xrpl_assert 2026-03-31 15:39:57 +01:00
3 changed files with 5 additions and 25 deletions

View File

@@ -95,11 +95,6 @@ setCurrentThreadNameImpl(std::string_view name)
{
std::cerr << "WARNING: Thread name \"" << name << "\" (length " << name.size()
<< ") exceeds maximum of " << maxThreadNameLength << " characters on Linux.\n";
XRPL_ASSERT(
false,
"beast::detail::setCurrentThreadNameImpl : Thread name exceeds "
"maximum length for Linux");
}
#endif
}

View File

@@ -56,8 +56,10 @@ OrderBookDBImpl::setup(std::shared_ptr<ReadView const> const& ledger)
}
else
{
// Shorten job name to fit Linux 15-char thread name limit with "j:" prefix
// "OB" + seq (max 9 digits) = 11 chars, + "j:" = 13 chars (fits in 15)
registry_.get().getJobQueue().addJob(
jtUPDATE_PF, "OBUpd" + std::to_string(ledger->seq()), [this, ledger]() {
jtUPDATE_PF, "OB" + std::to_string(ledger->seq() % 1000000000), [this, ledger]() {
update(ledger);
});
}

View File

@@ -130,11 +130,7 @@ ValidatorSite::load(
{
try
{
// This is not super efficient, but it doesn't happen often.
bool found = std::ranges::any_of(
sites_, [&uri](auto const& site) { return site.loadedResource->uri == uri; });
if (!found)
sites_.emplace_back(uri);
sites_.emplace_back(uri);
}
catch (std::exception const& e)
{
@@ -195,16 +191,6 @@ ValidatorSite::setTimer(
std::lock_guard<std::mutex> const& site_lock,
std::lock_guard<std::mutex> const& state_lock)
{
if (!sites_.empty() && //
std::ranges::all_of(
sites_, [](auto const& site) { return site.lastRefreshStatus.has_value(); }))
{
// If all of the sites have been handled at least once (including
// errors and timeouts), call missingSite, which will load the cache
// files for any lists that are still unavailable.
missingSite(site_lock);
}
auto next = std::min_element(sites_.begin(), sites_.end(), [](Site const& a, Site const& b) {
return a.nextRefresh < b.nextRefresh;
});
@@ -315,7 +301,7 @@ ValidatorSite::onRequestTimeout(std::size_t siteIdx, error_code const& ec)
// processes a network error. Usually, this function runs first,
// but on extremely rare occasions, the response handler can run
// first, which will leave activeResource empty.
auto& site = sites_[siteIdx];
auto const& site = sites_[siteIdx];
if (site.activeResource)
{
JLOG(j_.warn()) << "Request for " << site.activeResource->uri << " took too long";
@@ -323,9 +309,6 @@ ValidatorSite::onRequestTimeout(std::size_t siteIdx, error_code const& ec)
else
JLOG(j_.error()) << "Request took too long, but a response has "
"already been processed";
if (!site.lastRefreshStatus)
site.lastRefreshStatus.emplace(
Site::Status{clock_type::now(), ListDisposition::invalid, "timeout"});
}
std::lock_guard lock_state{state_mutex_};