I had thought that in 4.0 when a script was reloaded it was meant to have been loaded in a separate thread and then given to the rest of the threads. However it seems that this is not the case. Start a normal recursor, create a lua script which freezes on load like:
$ cat loop.lua
start = os.clock()
while os.clock() - start < 4 do
end
This prevents you from being able to do dns queries.
If it is not possible to execute the global context prior to giving script access to the other threads, perhaps you could create eg a initialize or setup function which is called from a separate recursor thread to do any data processing/loading without affecting recursor operation? Such a function could also return true/false to indicate whether or not to replace the current lua script or to rollback the load (as eg a script compilation error would currently do)
I had thought that in 4.0 when a script was reloaded it was meant to have been loaded in a separate thread and then given to the rest of the threads. However it seems that this is not the case. Start a normal recursor, create a lua script which freezes on load like:
Issue
rec_control reload-lua-script /etc/powerdns/loop.lua
This prevents you from being able to do dns queries.
If it is not possible to execute the global context prior to giving script access to the other threads, perhaps you could create eg a
initialize
orsetup
function which is called from a separate recursor thread to do any data processing/loading without affecting recursor operation? Such a function could also return true/false to indicate whether or not to replace the current lua script or to rollback the load (as eg a script compilation error would currently do)