From: Matthijs Mekking Date: Mon, 1 May 2023 12:43:59 +0000 (+0200) Subject: Extend serve-stale logging X-Git-Tag: v9.19.14~20^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=74d30879ba8e1385a7d66acec3f0ca49b4b885a2;p=thirdparty%2Fbind9.git Extend serve-stale logging Print the database lookup result in serve-stale logs for debugging potential future serve-stale issues. --- diff --git a/lib/ns/query.c b/lib/ns/query.c index f9c6f64f71b..63479e9a6c3 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -6035,10 +6035,12 @@ query_lookup(query_ctx_t *qctx) { } if (dbfind_stale) { - isc_log_write( - ns_lctx, NS_LOGCATEGORY_SERVE_STALE, NS_LOGMODULE_QUERY, - ISC_LOG_INFO, "%s %s resolver failure, stale answer %s", - namebuf, typebuf, stale_found ? "used" : "unavailable"); + isc_log_write(ns_lctx, NS_LOGCATEGORY_SERVE_STALE, + NS_LOGMODULE_QUERY, ISC_LOG_INFO, + "%s %s resolver failure, stale answer %s (%s)", + namebuf, typebuf, + stale_found ? "used" : "unavailable", + isc_result_totext(result)); if (stale_found) { ns_client_extendederror(qctx->client, ede, "resolver failure"); @@ -6058,9 +6060,10 @@ query_lookup(query_ctx_t *qctx) { isc_log_write(ns_lctx, NS_LOGCATEGORY_SERVE_STALE, NS_LOGMODULE_QUERY, ISC_LOG_INFO, "%s %s query within stale refresh time, stale " - "answer %s", + "answer %s (%s)", namebuf, typebuf, - stale_found ? "used" : "unavailable"); + stale_found ? "used" : "unavailable", + isc_result_totext(result)); if (stale_found) { ns_client_extendederror( @@ -6121,11 +6124,13 @@ query_lookup(query_ctx_t *qctx) { * the stale answer if available, otherwise wait until * the resolver finishes. */ - isc_log_write(ns_lctx, NS_LOGCATEGORY_SERVE_STALE, - NS_LOGMODULE_QUERY, ISC_LOG_INFO, - "%s %s client timeout, stale answer %s", - namebuf, typebuf, - stale_found ? "used" : "unavailable"); + isc_log_write( + ns_lctx, NS_LOGCATEGORY_SERVE_STALE, + NS_LOGMODULE_QUERY, ISC_LOG_INFO, + "%s %s client timeout, stale answer %s (%s)", + namebuf, typebuf, + stale_found ? "used" : "unavailable", + isc_result_totext(result)); if (stale_found) { ns_client_extendederror(qctx->client, ede, "client timeout");