Open alexlarsson opened 7 years ago
+1 - i've definitely seen issues where a failure to resolve a name during the middle of a pull results in the pull being aborted.
I don't believe glibc does any caching unless nscd is enabled, and nscd has lots of issues. I suggest NetworkManager with dns=dnsmasq
.
There's also systemd-resolved.
@cgwalters Don't you think it makes sense to only do a dns resolve once per pull operation though? I mean that way you'd e.g. always hit the same mirror instance for the entire operation, and also avoid a lot of dns requests.
@cgwalters I mean, in the non-static-delta case, are we really doing one DNS resolve operation for each object?
Well, HTTP keepalives should really obviate most DNS issues except for initial setup. It looks like pitivi.org
does keepalives.
I'm uncertain about caching DNS in ostree explicitly...feels like it's more libsoup/libcurl or the system's job; and actually one thing we likely want to enable is higher level software like gnome-software be able to use GNetworkMonitor
to dynamically watch for repos to become available. Doing something like that would end up implicitly caching DNS at a higher level.
That all sounds fine in theory, but people show up all the time with these dns issues.
I'm not saying there's no problem but...oh hm interesting, Firefox caches DNS. (I was about to argue that one really wanted a system-wide cache for web browsing etc. - AIUI e.g. Windows has a system-wide cache)
One thing here is that currently we do use multiple connections - so even if we're using keepalives, I suspect in the middle of a pull at least with libsoup we may end up failing if DNS transiently fails during a pull for the same server, even if we have an open connection.
I think what happens is that gnome has multiple dns servers, but generally only one is borked. So, if we resolve once we'll either fail the entire pull, or succeed it. Whereas without caching we're pretty much guaranteed to hit the borked one.
Also, i'm not sure we want a generic cache, but rather something that is part of OtPullData. I.e. one resolve per pull operation.
Additionally, it just seems safer in terms of things like round-robin dns mirroring to use the same server for the entire pull operation.
I've seen a lot of reports of DNS issues during flatpak install. It seems that sometimes one of the dns servers for gnome.org has a hiccup, which tends to abort the entire install.
Example user report
I wonder if we're doing something wrong wrt name resolution? Shouldn't glibc cache the resolve from the first lookup and reuse for each pull? Do we need to do the resolve once and then manually specify the IP for each request in the pull?