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

rec: Only log MOADNSExceptions if logging.log_common_errors is true. #14611

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

omoerbeek
Copy link
Member

But do not ratelimit them. Note that MOADNSExceptions is derived from std::runtime_errror and not from std::exception.

Also introduce the same logic related to gettag() in rec-tcp.cc compared to pdns_recursor.cc.
Churn is a bit high as s_rateLimitedLogger changed into g_rateLimitedLogger, to make it available in rec-tcp.cc.

Fixes #14582

Short description

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

@omoerbeek omoerbeek added this to the rec-5.2.0 milestone Aug 30, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10633018362

Details

  • 5 of 25 (20.0%) changed or added relevant lines in 3 files are covered.
  • 98 unchanged lines in 16 files lost coverage.
  • Overall coverage decreased (-0.02%) to 64.643%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pdns/recursordist/rec-tcp.cc 3 7 42.86%
pdns/recursordist/pdns_recursor.cc 1 7 14.29%
pdns/recursordist/rec-main.cc 1 11 9.09%
Files with Coverage Reduction New Missed Lines %
pdns/recursordist/rec-tcp.cc 1 65.73%
pdns/recursordist/rec-main.cc 1 61.89%
pdns/pollmplexer.cc 1 83.66%
pdns/sstuff.hh 2 56.83%
pdns/backends/gsql/gsqlbackend.hh 2 97.71%
pdns/misc.cc 2 63.43%
pdns/recursordist/test-syncres_cc2.cc 3 88.91%
pdns/stubresolver.cc 3 77.58%
pdns/recursordist/recpacketcache.hh 3 89.55%
pdns/shuffle.cc 4 39.71%
Totals Coverage Status
Change from base Build 10612335851: -0.02%
Covered Lines: 124625
Relevant Lines: 162099

💛 - Coveralls

@@ -2285,13 +2283,18 @@ static string* doProcessUDPQuestion(const std::string& question, const ComboAddr
eventTrace.add(RecEventTrace::LuaGetTag, ctag, false);
}
}
catch (const MOADNSException& moadnsexception) {
Copy link
Member

Choose a reason for hiding this comment

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

But do not ratelimit them. Note that MOADNSExceptions is derived from std::runtime_errror and not from std::exception.

Something is weird here, because std::runtime_error derives from std::exception.

Copy link
Member Author

Choose a reason for hiding this comment

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

I misread the docs on https://en.cppreference.com/w/cpp/error/runtime_error. The declaration does not show the base class, only the Inheritance diagram does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rec: Some "common" error messages are no longer hidden behind log-common-errors
3 participants