Sqlite3 locking

Angelo Ativo <[email protected]> Mon, 12 Sep 2016 19:53:37 +0000
Newsgroups gmane.network.dns.powerdns.devel
Message-ID <[email protected]>
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

_______________________________________________
Pdns-dev mailing list
[email protected]
https://mailman.powerdns.com/mailman/listinfo/pdns-dev
signature.asc (application/pgp-signature, 842 B)
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJX1wfBAAoJEIpi9HygYB4jxFAP/R3vXLa9FzZVi8eXkWhsRQR+
aB0wSm6fA4S9mBIvgxV9yZmc4Fz31Hgg4yKBvXLpfoGo/PZgiOxMeBoaArQTzlDV
cvcLW3qK/uOuy1F2dKLjjAM3yIaxMXhmWOsbtTeQuXtxHyFxzJhUskE0XkJjylGz
DM8CouzPJw0DKpz/NECqtpQlPS+yWICHkpmb2gLx9/PT0QGxU5Wm56Zgd1APrInP
VtjXjCl0UMh9nYzzO819DtRyc9aqp+ClnEE5V00/NAWtcbCq6SrWJq+9rtxWG3V3
vrVjTDp+MnpkGxxOJ/YYx3Wqf0nunfrDorejLG7FpfdWHuj0TyoydSOkrpVTRjR/
SbMGZA4/xzLp3dac4/y2wjWw3G36OpCTdfB87XUERzNnIztQ7uI76G9GU1WmvMoo
K8Sf2+11wtuWbOPSy8YN+HFTvbh6ILa/b8UZBcW1jfc4e1BisbV2fwsmwRxI+lN2
fUJEjsCncOxWmdGEr75fAqZc1YSmj+jNaoMJi2bjxcHnHvf4X7kU3aIcruujSg/D
vi/0MuTfALoG4/53K1s49/tywkHLDAaufZuDKHt3PUlS2UJc4gKqg/8gpwuHJrxU
r5RawSX3C6RDvfQVuWXkqjrFAr3vbTjjRF3nisuZXogQ+N1S+lv4Ui8X/MMTXv00
XYM798UHd3oCS1YjnX1a
=jUHk
-----END PGP SIGNATURE-----