Unlike other distros, CentOS download site uses something like round-robin DNS. The mirror.centos.org domain maps to one of many IPs. Sometimes an IP can be too slow or unreachable for some reason. In my case, 147.75.93.107 is unreachable from my location (South Korea).
wget automatically retries on such network failure, but with DNS cached. The solution to this problem is either
Restart wget process, as in get_from_filelistgz(). wget's DNS cache is only in memory.
Use --no-dns-cache option that tells wget to use different IP every retry.
This patch applies (2) to get_rpm().
A quick test show that the retry makes the download more robust.
Retry in
get_rpm()
without dns cache.Unlike other distros, CentOS download site uses something like round-robin DNS. The mirror.centos.org domain maps to one of many IPs. Sometimes an IP can be too slow or unreachable for some reason. In my case,
147.75.93.107
is unreachable from my location (South Korea).wget
automatically retries on such network failure, but with DNS cached. The solution to this problem is eitherget_from_filelistgz()
. wget's DNS cache is only in memory.--no-dns-cache
option that tells wget to use different IP every retry.This patch applies (2) to
get_rpm()
.A quick test show that the retry makes the download more robust.
This feature may be applied to other download functions like
get_debian()
, but this problem seems unlikely in other download sites.