public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: John Levon <levon@movementarian.org>
Cc: libc-alpha@sourceware.org
Subject: Re: Issue with stale resolv.conf state
Date: Mon, 11 Mar 2024 11:51:19 +0100	[thread overview]
Message-ID: <874jddqbx4.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <Ze7KCkIzR5PuErba@movementarian.org> (John Levon's message of "Mon, 11 Mar 2024 09:08:26 +0000")

* John Levon:

> I don't understand the first part of the comment, but indeed, ->resp doesn't
> match. In particular:
>
>  62   return ctx->resp->options == ctx->conf->options                                
>
> and ctx->resp (aka _resp) has 0x47002c1 whereas ctx->conf has 0x41002c1.
>
> I'm not sure but I suspect the additional RES_SNGLKUP|RES_SNGLKUPREOP
> may be due to this code:
>
> 1000                     /* There are quite a few broken name servers out             
> 1001                        there which don't handle two outstanding                  
> 1002                        requests from the same source.  There are also            
> 1003                        broken firewall settings.  If we time out after           
> 1004                        having received one answer switch to the mode             
> 1005                        where we send the second request only once we             
> 1006                        have received the first answer.  */                       
> 1007                     if (!single_request)                                         
> 1008                       {                                                          
> 1009                         statp->options |= RES_SNGLKUP;                           
> 1010                         single_request = true;                                   
> 1011                         *gotsomewhere = save_gotsomewhere;                       
> 1012                         goto retry;                                              
> 1013                       }                                                          
> 1014                     else if (!single_request_reopen)                             
> 1015                       {                                                          
> 1016                         statp->options |= RES_SNGLKUPREOP;                       
> 1017                         single_request_reopen = true;                            
> 1018                         *gotsomewhere = save_gotsomewhere;                       
> 1019                         __res_iclose (statp, false);                             
> 1020                         goto retry_reopen;                                       
> 1021                       }


That's a very good point.  Yes, the current reloading code does not take
into account that we change _res.options dynamically based on network
behavior.

That automatic configuration change based on temporary network glitches
is problematic in other contexts as well (it may further trigger bugs in
dual query processing).

Maybe we should just remove the automatic downgrade, basically not
persist this across queries anymore.

Thanks,
Florian


  reply	other threads:[~2024-03-11 10:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11  9:08 John Levon
2024-03-11 10:51 ` Florian Weimer [this message]
2024-03-12  0:51   ` Cristian Rodríguez
2024-03-12  6:45     ` Florian Weimer
2024-03-12  9:09       ` Philip Sanetra
2024-03-12 10:04       ` John Levon
2024-03-12 14:25       ` Cristian Rodríguez
2024-03-12 14:30         ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874jddqbx4.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=levon@movementarian.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).