]> git.ipfire.org Git - thirdparty/pdns.git/commit
fixes PowerDNS/pdns/657
authorMark Zealey <mark@markandruth.co.uk>
Mon, 2 Dec 2013 08:42:40 +0000 (10:42 +0200)
committerMark Zealey <mark@markandruth.co.uk>
Mon, 2 Dec 2013 08:42:40 +0000 (10:42 +0200)
commit85a41ee709ffe087291e530078745f5ac1ff9c37
tree381f9410bbd18a1bf8290223e682154ad7c45373
parent7874ab05a2073a1bfaea6180bbf2ef01afde9cfd
fixes PowerDNS/pdns/657

I noticed this as a result of the changes in 3.2 whereby each receiver gets its own distributor - whenever the dynhandler calls ->getBackend() it will only find the one in its' current thread, so reload won't propergate to backends within other threads.

However, I suspect this condition has always been around as a race - if I have multiple distributors and I call reload; one thread is issuing reloads while all the other backend threads are currently executing (potentially). I guess if you call reload in previous versions on a highly loaded server with multiple backends you could probably get it to crash.

The attached patch changes it so that each backend has a variable which is changed to signal that a reload or rediscover has been requested. When processing gets to an appropriate point ie before it next queries the backend database, such an operation will be run. Note that it is not run in ::get as we don't want a backend to be reloaded between performing a lookup and getting the records.

This patch means that reload/reinitialize are not done straight away as in previous versions, but on a moderately loaded server this should not be a problem as they will be performed the next time a backend is called.
pdns/dynhandler.cc
pdns/ueberbackend.cc
pdns/ueberbackend.hh