samba_dnsupdate timeouts (was Re: [PATCH] python indent bugfix in dns_hub.py)

Stefan Metzmacher metze at samba.org
Thu Feb 7 14:09:03 UTC 2019


Am 07.02.19 um 14:29 schrieb Volker Lendecke via samba-technical:
> On Thu, Feb 07, 2019 at 10:37:25AM +0100, Stefan Metzmacher wrote:
>> Currently samba_dnsupdate (on the RODC) constantly recreates its irpc
>> handle (and the messaging context and the dgram socket). This causes
>> problems when winbindd tries to send back the result to samba_dnsupdate,
>> as winbindd's messaging context caches connected dgram sockets per
>> target pid for 1 second. As the target (samba_dnsupdate) constantly
>> recreates its socket, winbindd very likely hits ECONNREFUSED when
>> the socket is recreated multiple times within 1 second.
>> As a result samba_dnsupdate hits a 10 second irpc timeout, so the
>> whole samba_dnsupdate hits the 20 second timeout on the RODC.
> 
> Without having looked at the code: Can you explain that in a bit more
> detail? My assumption was that a messaging context has to live longer
> than the RPC requests issued via it. Or am I messing up things really
> badly here?

The key is that we have this:

while (true) {
   msg_ctx = messaging_init();
   messaging_register(msg_ctx, NULL, MSG_PONG, pong_message);
   messaging_send(msg_ctx, MSG_PING, ...)
   TALLOC_FREE(msg_ctx);
}

messaging_init() calls messaging_dgm_init() = > socket()/bind()
and TALLOC_CTX() calls unlink()

As discussed catching ECONNREFUSED and retry would also be fix for the
problem, them my samba_dnsupdate patch is just an optimization.

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190207/fd3f60e1/signature.sig>


More information about the samba-technical mailing list