Skip to content

Instantly share code, notes, and snippets.

@Habbie
Created September 15, 2025 10:06
Show Gist options
  • Save Habbie/2df95d193f376e6ff54ca2f634755c41 to your computer and use it in GitHub Desktop.
Save Habbie/2df95d193f376e6ff54ca2f634755c41 to your computer and use it in GitHub Desktop.
diff --git a/pdns/lua-record.cc b/pdns/lua-record.cc
index d649beaba1..c3773ae75f 100644
--- a/pdns/lua-record.cc
+++ b/pdns/lua-record.cc
@@ -1440,6 +1440,7 @@ static string lua_pickclosest(const iplist_t& ips)
static void lua_report(const string& /* event */, const boost::optional<string>& /* line */)
{
throw std::runtime_error("Script took too long");
+ // ::abort();
}
static string lua_geoiplookup(const string &address, const GeoIPInterface::GeoIPQueryAttribute attr)
@@ -1764,14 +1765,17 @@ static void setupLuaRecords(LuaContext& lua)
}
std::vector<shared_ptr<DNSRecordContent>> luaSynth(const std::string& code, const DNSName& query, const DNSZoneRecord& zone_record, const DNSName& zone, const DNSPacket& dnsp, uint16_t qtype, unique_ptr<AuthLua4>& LUA)
-{
+{
+ std::vector<shared_ptr<DNSRecordContent>> ret;
+
+ try {
if(!LUA || // we don't have a Lua state yet
!g_LuaRecordSharedState) { // or we want a new one even if we had one
LUA = make_unique<AuthLua4>(::arg()["lua-global-include-dir"]);
setupLuaRecords(*LUA->getLua());
}
- std::vector<shared_ptr<DNSRecordContent>> ret;
+ // std::vector<shared_ptr<DNSRecordContent>> ret;
LuaContext& lua = *LUA->getLua();
@@ -1800,7 +1804,6 @@ std::vector<shared_ptr<DNSRecordContent>> luaSynth(const std::string& code, cons
}
lua.writeVariable("bestwho", s_lua_record_ctx->bestwho);
- try {
string actual;
if(!code.empty() && code[0]!=';')
actual = "return " + code;
diff --git a/regression-tests.auth-py/test_LuaRecords.py b/regression-tests.auth-py/test_LuaRecords.py
index 6ea2ef1622..3b84c6fe12 100644
--- a/regression-tests.auth-py/test_LuaRecords.py
+++ b/regression-tests.auth-py/test_LuaRecords.py
@@ -1250,7 +1250,9 @@ any-to-tcp=no
enable-lua-records=shared
lua-records-insert-whitespace=yes
lua-health-checks-interval=1
-lua-records-exec-limit=1500
+# lua-records-exec-limit=1500
+traceback-handler=no
+loglevel-show
"""
def testCounter(self):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment