[Pdns-users] remote backend

Alexis Fidalgo alzrck at gmail.com
Wed Nov 29 10:19:23 UTC 2023



> On 29 Nov 2023, at 05:00, Brian Candler <b.candler at pobox.com> wrote:
> 
> On 29/11/2023 00:07, Alexis Fidalgo via Pdns-users wrote:
>> I think i found why this is not working, as you can see below, socket is connected and first message is sent (the initialize message), which is answered and the response is read ({“result”: true}).
>> 
>> Problem is (and i’ve testing with golang and python) after the answer the “initialize” message, the socket is closed,
> 
> By whom - by PowerDNS, or by your remote backend application code? I think it's the latter, and if so, the problem is at your side, not PowerDNS.
> 

by the responder, what im not understanding is, why in 2 different languages (golang and python) i get the same behavior.


> It would be extremely inefficient for PowerDNS to open a new connection for every message and close it immediately afterwards. That would be like HTTP without keepalive.  And it would make no sense to send an "initialize" message to setup a connection, only to drop the connection immediately afterwards.

I agree on this, makes no sense at all to close the socket after each message, what i found even worse is (again, at least in golang and python), from server side on the UDS. Im seeing 

. bind the socket to the fd
. open the socket
. Accept from the socket (locks)
. Reads from the socket
. Answer to the socket (*)
. Locks for ever if i dont close it

(*) it doesnt matter if i process/answer in the same thread/coroutine or in a different one.

Im with you on this, right after Accept + Read, if im processing/answering in a different thread, it should go immediately to accept again and lock there waiting for a new message and so on, that’s the correct way to act, but im not getting that.

Still convinced that there’s no better option as to write my backend but im not good at c++ (im not good with others eigther :) :) )






More information about the Pdns-users mailing list