]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2276] Add TIMEOUT log messages to new classes
authorThomas Markwalder <tmark@isc.org>
Tue, 6 Jun 2023 14:53:43 +0000 (10:53 -0400)
committerThomas Markwalder <tmark@isc.org>
Thu, 6 Jul 2023 14:27:25 +0000 (14:27 +0000)
/src/bin/d2/check_exists_add.cc
/src/bin/d2/check_exists_remove.cc
/src/bin/d2/simple_add_without_dhcid.cc
/src/bin/d2/simple_remove_without_dhcid.cc

src/bin/d2/check_exists_add.cc
src/bin/d2/check_exists_remove.cc
src/bin/d2/simple_add_without_dhcid.cc
src/bin/d2/simple_remove_without_dhcid.cc

index 0353fb2316d7ed73f8c2824ed9db50d56de8642c..dade71eeed8f57e31a7b177ff279c8419546cd44 100644 (file)
@@ -234,11 +234,19 @@ CheckExistsAddTransaction::addingFwdAddrsHandler() {
         }
 
         case DNSClient::TIMEOUT:
+            // No response from the server, log it and set up
+            // to select the next server for a retry.
+            LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_ADD_TIMEOUT)
+                      .arg(getRequestId())
+                      .arg(getNcr()->getFqdn())
+                      .arg(getCurrentServer()->toText());
+
+            retryTransition(SELECTING_FWD_SERVER_ST);
+            break;
+
         case DNSClient::OTHER:
             // We couldn't send to the current server, log it and set up
             // to select the next server for a retry.
-            // @note For now we treat OTHER as an IO error like TIMEOUT. It
-            // is not entirely clear if this is accurate.
             LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_ADD_IO_ERROR)
                       .arg(getRequestId())
                       .arg(getNcr()->getFqdn())
@@ -348,11 +356,19 @@ CheckExistsAddTransaction::replacingFwdAddrsHandler() {
         }
 
         case DNSClient::TIMEOUT:
+            // No response from the server, log it and set up
+            // to select the next server for a retry.
+            LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REPLACE_TIMEOUT)
+                      .arg(getRequestId())
+                      .arg(getNcr()->getFqdn())
+                      .arg(getCurrentServer()->toText());
+
+            retryTransition(SELECTING_FWD_SERVER_ST);
+            break;
+
         case DNSClient::OTHER:
             // We couldn't send to the current server, log it and set up
             // to select the next server for a retry.
-            // @note For now we treat OTHER as an IO error like TIMEOUT. It
-            // is not entirely clear if this is accurate.
             LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REPLACE_IO_ERROR)
                       .arg(getRequestId())
                       .arg(getNcr()->getFqdn())
@@ -484,11 +500,19 @@ CheckExistsAddTransaction::replacingRevPtrsHandler() {
         }
 
         case DNSClient::TIMEOUT:
+            // No response from the server, log it and set up
+            // to select the next server for a retry.
+            LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_REVERSE_REPLACE_TIMEOUT)
+                      .arg(getRequestId())
+                      .arg(getNcr()->getFqdn())
+                      .arg(getCurrentServer()->toText());
+
+            retryTransition(SELECTING_REV_SERVER_ST);
+            break;
+
         case DNSClient::OTHER:
             // We couldn't send to the current server, log it and set up
             // to select the next server for a retry.
-            // @note For now we treat OTHER as an IO error like TIMEOUT. It
-            // is not entirely clear if this is accurate.
             LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_REVERSE_REPLACE_IO_ERROR)
                       .arg(getRequestId())
                       .arg(getNcr()->getFqdn())
index 87b9fa0d20dc74243ddb8d6d3c5a38fa832b4036..10d4566c71564b4b1a65b9b493bbfd47de9a8805 100644 (file)
@@ -231,11 +231,19 @@ CheckExistsRemoveTransaction::removingFwdAddrsHandler() {
         }
 
         case DNSClient::TIMEOUT:
+            // No response from the server, log it and set up
+            // to select the next server for a retry.
+            LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REMOVE_ADDRS_TIMEOUT)
+                      .arg(getRequestId())
+                      .arg(getNcr()->getFqdn())
+                      .arg(getCurrentServer()->toText());
+
+            retryTransition(SELECTING_FWD_SERVER_ST);
+            break;
+
         case DNSClient::OTHER:
             // We couldn't send to the current server, log it and set up
             // to select the next server for a retry.
-            // @note For now we treat OTHER as an IO error like TIMEOUT. It
-            // is not entirely clear if this is accurate.
             LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REMOVE_ADDRS_IO_ERROR)
                       .arg(getRequestId())
                       .arg(getNcr()->getFqdn())
@@ -348,12 +356,9 @@ CheckExistsRemoveTransaction::removingFwdRRsHandler() {
         }
 
         case DNSClient::TIMEOUT:
-        case DNSClient::OTHER:
-            // We couldn't send to the current server, log it and set up
+            // No response from the server, log it and set up
             // to select the next server for a retry.
-            // @note For now we treat OTHER as an IO error like TIMEOUT. It
-            // is not entirely clear if this is accurate.
-            LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REMOVE_RRS_IO_ERROR)
+            LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REMOVE_RRS_TIMEOUT)
                       .arg(getRequestId())
                       .arg(getNcr()->getFqdn())
                       .arg(getCurrentServer()->toText());
@@ -369,6 +374,18 @@ CheckExistsRemoveTransaction::removingFwdRRsHandler() {
             retryTransition(PROCESS_TRANS_FAILED_ST);
             break;
 
+        case DNSClient::OTHER:
+            // We couldn't send to the current server, log it and set up
+            // to select the next server for a retry.
+            LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REMOVE_RRS_IO_ERROR)
+                      .arg(getRequestId())
+                      .arg(getNcr()->getFqdn())
+                      .arg(getCurrentServer()->toText());
+
+            // @note same commentary as in TIMEOUT above case.
+            retryTransition(PROCESS_TRANS_FAILED_ST);
+            break;
+
         case DNSClient::INVALID_RESPONSE:
             // A response was received but was corrupt. Retry it like an IO
             // error.
@@ -496,11 +513,21 @@ CheckExistsRemoveTransaction::removingRevPtrsHandler() {
         }
 
         case DNSClient::TIMEOUT:
+            // No response from the server, log it and set up
+            // to select the next server for a retry.
+            LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_REVERSE_REMOVE_TIMEOUT)
+                      .arg(getRequestId())
+                      .arg(getNcr()->getFqdn())
+                      .arg(getCurrentServer()->toText());
+
+            // If we are out of retries on this server, we go back and start
+            // all over on a new server.
+            retryTransition(SELECTING_REV_SERVER_ST);
+            break;
+
         case DNSClient::OTHER:
             // We couldn't send to the current server, log it and set up
             // to select the next server for a retry.
-            // @note For now we treat OTHER as an IO error like TIMEOUT. It
-            // is not entirely clear if this is accurate.
             LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_REVERSE_REMOVE_IO_ERROR)
                       .arg(getRequestId())
                       .arg(getNcr()->getFqdn())
index d204ed5e523c490834a4320ced798ce1a2c24784..bec84a155893ead89a4123dce1b5ec828124d314 100644 (file)
@@ -223,11 +223,19 @@ SimpleAddWithoutDHCIDTransaction::replacingFwdAddrsHandler() {
         }
 
         case DNSClient::TIMEOUT:
+            // No response from the server, log it and set up
+            // to select the next server for a retry.
+            LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_ADD_TIMEOUT)
+                      .arg(getRequestId())
+                      .arg(getNcr()->getFqdn())
+                      .arg(getCurrentServer()->toText());
+
+            retryTransition(SELECTING_FWD_SERVER_ST);
+            break;
+
         case DNSClient::OTHER:
             // We couldn't send to the current server, log it and set up
             // to select the next server for a retry.
-            // @note For now we treat OTHER as an IO error like TIMEOUT. It
-            // is not entirely clear if this is accurate.
             LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_ADD_IO_ERROR)
                       .arg(getRequestId())
                       .arg(getNcr()->getFqdn())
@@ -354,11 +362,21 @@ SimpleAddWithoutDHCIDTransaction::replacingRevPtrsHandler() {
         }
 
         case DNSClient::TIMEOUT:
+            // No response from the server, log it and set up
+            // to select the next server for a retry.
+            LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_REVERSE_REPLACE_TIMEOUT)
+                      .arg(getRequestId())
+                      .arg(getNcr()->getFqdn())
+                      .arg(getCurrentServer()->toText());
+
+            // If we are out of retries on this server, we go back and start
+            // all over on a new server.
+            retryTransition(SELECTING_REV_SERVER_ST);
+            break;
+
         case DNSClient::OTHER:
             // We couldn't send to the current server, log it and set up
             // to select the next server for a retry.
-            // @note For now we treat OTHER as an IO error like TIMEOUT. It
-            // is not entirely clear if this is accurate.
             LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_REVERSE_REPLACE_IO_ERROR)
                       .arg(getRequestId())
                       .arg(getNcr()->getFqdn())
index fd0c58f34a5a314e917d70a53ece02b141ca4c8c..d96939b558e91094b06d3f54b4fbe75663f7b945 100644 (file)
@@ -235,11 +235,19 @@ SimpleRemoveWithoutDHCIDTransaction::removingFwdRRsHandler() {
         }
 
         case DNSClient::TIMEOUT:
+            // No response from the server, log it and set up
+            // to select the next server for a retry.
+            LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REMOVE_RRS_TIMEOUT)
+                      .arg(getRequestId())
+                      .arg(getNcr()->getFqdn())
+                      .arg(getCurrentServer()->toText());
+
+            retryTransition(SELECTING_FWD_SERVER_ST);
+            break;
+
         case DNSClient::OTHER:
             // We couldn't send to the current server, log it and set up
             // to select the next server for a retry.
-            // @note For now we treat OTHER as an IO error like TIMEOUT. It
-            // is not entirely clear if this is accurate.
             LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_FORWARD_REMOVE_RRS_IO_ERROR)
                       .arg(getRequestId())
                       .arg(getNcr()->getFqdn())
@@ -373,11 +381,21 @@ SimpleRemoveWithoutDHCIDTransaction::removingRevPtrsHandler() {
         }
 
         case DNSClient::TIMEOUT:
+            // No response from the server, log it and set up
+            // to select the next server for a retry.
+            LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_REVERSE_REMOVE_TIMEOUT)
+                      .arg(getRequestId())
+                      .arg(getNcr()->getFqdn())
+                      .arg(getCurrentServer()->toText());
+
+            // If we are out of retries on this server, we go back and start
+            // all over on a new server.
+            retryTransition(SELECTING_REV_SERVER_ST);
+            break;
+
         case DNSClient::OTHER:
             // We couldn't send to the current server, log it and set up
             // to select the next server for a retry.
-            // @note For now we treat OTHER as an IO error like TIMEOUT. It
-            // is not entirely clear if this is accurate.
             LOG_ERROR(d2_to_dns_logger, DHCP_DDNS_REVERSE_REMOVE_IO_ERROR)
                       .arg(getRequestId())
                       .arg(getNcr()->getFqdn())