[PATCH] resolv: Disable TCP servers in tst-resolv-res_init-failure

Carlos O'Donell codonell@redhat.com
Mon Jul 20 15:03:32 GMT 2026


On 7/20/26 10:27 AM, Florian Weimer wrote:
> This avoids spurious xaccept errors on slow systems.

v2 requested.

> ---
>   resolv/tst-resolv-res_init-failure.c | 15 ++++++++++++++-
>   1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/resolv/tst-resolv-res_init-failure.c b/resolv/tst-resolv-res_init-failure.c
> index d20348acf2..ae782c3f12 100644
> --- a/resolv/tst-resolv-res_init-failure.c
> +++ b/resolv/tst-resolv-res_init-failure.c
> @@ -66,7 +66,20 @@ static int
>   do_test (void)
>   {
>     struct resolv_test *aux = resolv_test_start
> -    ((struct resolv_redirect_config) { .response_callback = response });
> +    ((struct resolv_redirect_config)
> +     {
> +       .response_callback = response,
> +       /* Disable TCP servers.  The kernel pre-allocates the client FD
> +	  in the accept system call, leading to accept failures if
> +	  setrlimit below completes before TCP accept setup on the TCP
> +	  DNS server threads.  */

May you expand the comment to explain where the race comes from?

Suggestion:
/* Disable TCP servers.  The kernel pre-allocates the client FD
    when the server thread calls the accept system call, leading to
    a later test accept failures if the setrlimit below completes
    before TCP accept setup on the TCP DNS server threads.  */

I'd like to distinguish which accept call we're talking about.

> +       .servers =
> +	 {
> +	   { .disable_tcp = true, },
> +	   { .disable_tcp = true, },
> +	   { .disable_tcp = true, },
> +	 },
> +     });
>   
>     /* Initial lookup.  This drives __res_context_send through its init
>        block, which allocates _u._ext.nsaddrs[] and sets
> 
> base-commit: 249639137ed360d1827d9e663261ba26d2b01d81
> 



More information about the Libc-alpha mailing list