From 2b3b94f3c15aef57830bd81b9580d31d2e837612 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Aug 30 2017 13:55:58 +0000 Subject: DNS update: reduce timeout for CA records Timeout 120 seconds is quite long and it makes uninstallation too long for. Given that this is non critical operation and may be executed manually later, waiting 120 seconds is too much. Usually waiting longer will not help at all to resolve missing record. 30 seconds is long enough 🕯 https://pagure.io/freeipa/issue/6176 Reviewed-By: Tomas Krizek --- diff --git a/ipaserver/dns_data_management.py b/ipaserver/dns_data_management.py index d4dc42e..2008ba6 100644 --- a/ipaserver/dns_data_management.py +++ b/ipaserver/dns_data_management.py @@ -52,6 +52,8 @@ IPA_DEFAULT_NTP_SRV_REC = ( (DNSName("_ntp._udp"), 123), ) +CA_RECORDS_DNS_TIMEOUT = 30 # timeout in seconds + class IPADomainIsNotManagedByIPAError(Exception): pass @@ -131,7 +133,7 @@ class IPASystemRecords(object): assert isinstance(hostname, DNSName) and hostname.is_absolute() r_name = DNSName('ipa-ca') + self.domain_abs rrsets = [] - end_time = time() + 120 # timeout in seconds + end_time = time() + CA_RECORDS_DNS_TIMEOUT while time() < end_time: try: rrsets = resolve_rrsets(hostname, (rdatatype.A, rdatatype.AAAA))