dns: get_reverse_zone: Ignore resolver's timeout

The DNS server may not process a query in a its internal timeout for
a some reason or don't answer for a query at all. This may indicate
a high load on DNS server. For example, if IPA DNS server is
configured with 'none' forward policy (read as resolver), then
SERVFAIL/Timeout errors will be normal until the hot cache for zones.
Resolver's timeout in turn, indicates that it queried a server, but
didn't received an answer in specified timeout.

Related: https://pagure.io/freeipa/issue/7397
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Stanislav Levin 2021-05-14 19:02:36 +03:00 committed by Alexander Bokovoy
parent 4709aefb83
commit 269c61a9a6

View File

@ -555,6 +555,13 @@ def get_reverse_zone(ipaddr):
'All nameservers failed to answer the query '
'for DNS reverse zone %(revdns)s') % dict(revdns=revdns)
)
except dns.resolver.Timeout:
raise errors.NotFound(
reason=_(
"No answers could be found in the specified lifetime "
"for DNS reverse zone %(revdns)s"
) % dict(revdns=revdns)
)
try:
api.Command['dnszone_show'](revzone)