[Pdns-dev] pipebackend LOG bug

David Hawthorne dhawth at 3crowd.com
Wed May 12 20:04:41 CEST 2010


If you have a backend script (backend.pl) that has a long initialization time before reporting (say you insert a sleep 3 at the beginning of backend.pl), any LOG statements by running backends (if you're running with distributor-threads > 1) will not show up in logs or on console at any loglevel until all backends have initialized.

Steps to recreate:

1.  add a sleep 3 to backend.pl
2.  add a LOG statement per request that comes in
3.  set distributor-threads = 3
4.  start pdns_server with loglevel=10 and daemon=no
5.  wait until the 3 backends have initialized and report in

May 12 10:58:18 About to create 3 backend threads for UDP
May 12 10:58:18 Done launching threads, ready to distribute questions
May 12 10:58:22 Backend launched with banner: OK        Sample backend firing up
May 12 10:58:22 Backend launched with banner: OK        Sample backend firing up
May 12 10:58:22 Backend launched with banner: OK        Sample backend firing up

6.  Throw some traffic at it with dig and watch the logs.  You will see that they either don't show up at all or only some of them show up.  This is also when the distributor will start up the extra 2 processes it wants.

May 12 10:58:48 Distributor misses a thread (3<3), spawning new one
May 12 10:58:53 Backend launched with banner: OK        Sample backend firing up
May 12 10:59:07 Distributor misses a thread (4<3), spawning new one
May 12 10:59:11 Backend launched with banner: OK        Sample backend firing up

7.  Once those processes are started up, LOG will function normally.


More information about the Pdns-dev mailing list