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

dnsdist: Clean up the Lua objects before exiting #13667

Merged

Conversation

rgacogne
Copy link
Member

Short description

When code coverage is enabled, we try to call exit() instead of our usual use of _exit() to get more accurate coverage. It does however trigger a race condition between the destruction of Lua objects and the Lua context(s) they belong to, so we try to explicitly clean up the objects before calling exit().

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)

When code coverage is enabled, we try to call `exit()` instead of our
usual use of `_exit()` to get more accurate coverage. It does however
trigger a race condition between the destruction of Lua objects and
the Lua context(s) they belong to, so we try to explicitly clean up
the objects before calling `exit()`.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 7329839915

  • 2 of 3 (66.67%) changed or added relevant lines in 1 file are covered.
  • 46 unchanged lines in 11 files lost coverage.
  • Overall coverage decreased (-0.02%) to 57.679%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pdns/dnsdist.cc 2 3 66.67%
Files with Coverage Reduction New Missed Lines %
pdns/dnsdist.cc 1 71.56%
pdns/query-local-address.cc 2 76.6%
pdns/rcpgenerator.cc 2 90.41%
pdns/ws-auth.cc 2 80.84%
modules/lmdbbackend/lmdbbackend.cc 3 72.35%
pdns/misc.hh 3 82.52%
pdns/iputils.cc 4 45.31%
pdns/signingpipe.cc 5 85.75%
pdns/dnsdist-carbon.cc 6 60.99%
pdns/recursordist/test-syncres_cc1.cc 6 88.99%
Totals Coverage Status
Change from base Build 7329684697: -0.02%
Covered Lines: 107677
Relevant Lines: 155323

💛 - Coveralls

@rgacogne rgacogne merged commit 369b105 into PowerDNS:master Jan 8, 2024
75 checks passed
@rgacogne rgacogne deleted the ddist-coverage-cleanup-lua-on-exception branch January 8, 2024 16:55
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.

None yet

3 participants