Request for comment for async resolution of DNS names

Matthieu Patou mat at
Sat Feb 11 07:50:05 UTC 2017

On 02/10/2017 02:30 AM, Stefan Metzmacher wrote:
> Hi Matthieu,
>> On 02/09/2017 12:33 AM, Volker Lendecke wrote:
>>> On Wed, Feb 08, 2017 at 11:10:11AM -0800, Matthieu Patou wrote:
>>> <snip>
>>> Can you restructure the code to only call getaddrinfo and nothing else
>>> in the threaded job.
>> Please find attached an updated version of the patch, it should do very
>> minimal things in the thread function.
>> It seems to work for me both when I have additional records in the SRV
>> response and when I haven't, valgrind didn't seems to complain and net
>> joins seems to work.
>> I need more tests but so
>> There was an alternative solution (that I have saved somewhere) where I
>> cheat with the struct dns_rr_srv structure to pass the struct addrinfo
>> back to the main thread by using the pointer to struct sockaddr_storage
>> to store the point to struct addrinfo.
>> But Jeremy was not very keen on it, so instead here is the variant where
>> there is a separate state structure for the resolve_one_name function.
> It seems we already have getaddrinfo_send/recv can't we just use them?
> There're currently based on fncall_send/recv and are also available
> in older releases.
> metze
I guess this is just the replacement for doing with pthreadpool_tevent +
getaddrinfo that I have in the patch.

Jeremy can you confirm before I do the 4th implementation ?


Matthieu Patou
Samba Team

More information about the samba-technical mailing list