[Pdns-users] throwing AhuException from module not working properly?

David Hawthorne dsrthorne at gmail.com
Thu Jul 5 02:55:35 UTC 2012

This is with pdns-3.1.

I'm throwing AhuExceptions in my module under the assumption that the docs in dnsbackend.hh are correct, and it's not causing the backend object to be destroyed and recreated.

docs from dnsbackend.hh:

    More serious errors, which may indicate that the database connection is hosed, or a configuration error occurred, should
    lead to the throwing of an AhuException. This exception will fall straight through the UeberBackend and the PacketHandler
    and be caught by the Distributor, which will delete your DNSBackend instance and spawn a new one.

This is exactly what I want to happen, but it isn't because the Distributor doesn't seem to ever see the exception.

It's being caught in packethandler.cc and not re-thrown:

        catch (AhuException &e)
                L << Logger::Error << "Database module reported condition which prevented lookup (" + e.reason + ") sending out servfail" << endl;
                S.ringAccount("servfail-queries", p->qdomain);

Any help you can give would be greatly appreciated!

More information about the Pdns-users mailing list