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 error conditions when fetching validator list. #2243

Closed
wants to merge 1 commit into from
Closed
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
20 changes: 20 additions & 0 deletions src/ripple/app/misc/impl/ValidatorSite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,16 @@ ValidatorSite::onSiteFetch(
"Invalid validator list from " <<
sites_[siteIdx].uri;
}
else if (ListDisposition::unsupported_version == disp)
{
JLOG (j_.warn()) <<
"Unsupported version validator list from " <<
sites_[siteIdx].uri;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is any chance of ListDisposition getting additional values in the future, I suggest adding a final case.

else
{
  BOOST_ASSERT(false);
}

That would make it a little more likely that we catch missing cases like this in the future, and gets optimized out in release builds.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

else
{
BOOST_ASSERT(false);
}

if (body.isMember ("refresh_interval") &&
body["refresh_interval"].isNumeric ())
Expand All @@ -269,6 +279,16 @@ ValidatorSite::onSiteFetch(
sites_[siteIdx].uri;
}
}
else
{
JLOG (j_.warn()) <<
"Problem retrieving from " <<
sites_[siteIdx].uri <<
" " <<
ec.value() <<
":" <<
ec.message();
}

std::lock_guard <std::mutex> lock{state_mutex_};
fetching_ = false;
Expand Down