Browse Source

[1612] log when responding with SERVFAIL

Jelte Jansen 13 years ago
parent
commit
56f14dee95
2 changed files with 17 additions and 1 deletions
  1. 13 0
      src/bin/auth/auth_messages.mes
  2. 4 1
      src/bin/auth/auth_srv.cc

+ 13 - 0
src/bin/auth/auth_messages.mes

@@ -264,3 +264,16 @@ NOTIFY request will not be honored.
 % AUTH_INVALID_STATISTICS_DATA invalid specification of statistics data specified
 An error was encountered when the authoritiative server specified
 statistics data which is invalid for the auth specification file.
+
+% AUTH_RESPONSE_FAILURE exception while building response to query: %1
+This is a debug message, generated by the authoritative server when an
+attempt to create a response to a received DNS packet has failed. The
+reason for the failure is given in the log message. A SERVFAIL response
+is sent back. The most likely cause of this is an error in the data
+source implementation; it is either creating bad responses or raising
+exceptions itself.
+
+% AUTH_RESPONSE_FAILURE_UNKNOWN unknown exception while building response to query
+This debug message is similar to AUTH_RESPONSE_FAILURE, but further
+details about the error are unknown, because it was signaled by something
+which is not an exception. This is definitely a bug.

+ 4 - 1
src/bin/auth/auth_srv.cc

@@ -508,9 +508,12 @@ AuthSrv::processMessage(const IOMessage& io_message, MessagePtr message,
                                                         buffer, tsig_context);
             }
         }
-    } catch (const isc::Exception&) {
+    } catch (const std::exception& ex) {
+        LOG_DEBUG(auth_logger, DBG_AUTH_DETAIL, AUTH_RESPONSE_FAILURE)
+                  .arg(ex.what());
         makeErrorMessage(message, buffer, Rcode::SERVFAIL());
     } catch (...) {
+        LOG_DEBUG(auth_logger, DBG_AUTH_DETAIL, AUTH_RESPONSE_FAILURE_UNKNOWN);
         makeErrorMessage(message, buffer, Rcode::SERVFAIL());
     }
     impl_->resumeServer(server, message, send_answer);