[Pdns-dev] Sqlite3 locking

Angelo Ativo aativo at threatstop.com
Mon Sep 12 19:53:37 UTC 2016


Hi,

Given the nature of sqlite file locking, is there some sort of “retry” functionality in the works or already implemented that would allow a failed NSUPDATE to be retried in the case that the DB file is currently being held in an exclusive lock? Currently, it looks like the code here: https://github.com/PowerDNS/pdns/blob/6b853804b4c06fd39f1e26e216e7443b781570f6/pdns/backends/gsql/gsqlbackend.cc#L1289 <https://github.com/PowerDNS/pdns/blob/6b853804b4c06fd39f1e26e216e7443b781570f6/pdns/backends/gsql/gsqlbackend.cc#L1289> will simply throw an error message if the DB is currently locked. I tested this to confirm and received: "GSQLBackend unable to feed record: Error while retrieving SQLite query results: database is locked; Sending ServFail!”

Wouldn’t the chances of this failure be relatively high if there were say, hundreds of NSUPDATE requests to a PDNS server backed by sqlite3 every second? What happens when two NSUPDATE requests occur at the exact same time?

Thanks,
—Angelo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-dev/attachments/20160912/052a94b9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mailman.powerdns.com/pipermail/pdns-dev/attachments/20160912/052a94b9/attachment.sig>


More information about the Pdns-dev mailing list