mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
fix: usr: Report when a zone reload is already in progress
If a zone reload was already in progress when `rndc reload <zone>` was run, the message returned was "zone reload queued", which was technically correct, but it was identical to the message returned when a reload was not in progress. Consequently, a user could issue two reload commands without realizing that only one reload had actually taken place. This has been addressed by changing the message returned to "zone reload was already queued". Closes #5140 Merge branch '5140-report-reload-in-progress' into 'main' See merge request isc-projects/bind9!10849
This commit is contained in:
commit
0caba8e9ce
7 changed files with 91 additions and 78 deletions
|
|
@ -9458,7 +9458,7 @@ load_zones(named_server_t *server, bool reconfig) {
|
|||
result = dns_zone_load(view->managed_keys, false);
|
||||
if (result != ISC_R_SUCCESS &&
|
||||
result != DNS_R_UPTODATE &&
|
||||
result != DNS_R_CONTINUE)
|
||||
result != ISC_R_LOADING && result != DNS_R_CONTINUE)
|
||||
{
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -9467,7 +9467,7 @@ load_zones(named_server_t *server, bool reconfig) {
|
|||
result = dns_zone_load(view->redirect, false);
|
||||
if (result != ISC_R_SUCCESS &&
|
||||
result != DNS_R_UPTODATE &&
|
||||
result != DNS_R_CONTINUE)
|
||||
result != ISC_R_LOADING && result != DNS_R_CONTINUE)
|
||||
{
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
@ -10475,6 +10475,10 @@ named_server_reloadcommand(named_server_t *server, isc_lex_t *lex,
|
|||
msg = "zone reload queued";
|
||||
result = ISC_R_SUCCESS;
|
||||
break;
|
||||
case ISC_R_LOADING:
|
||||
msg = "zone reload was already queued";
|
||||
result = ISC_R_SUCCESS;
|
||||
break;
|
||||
case DNS_R_UPTODATE:
|
||||
msg = "zone reload up-to-date";
|
||||
result = ISC_R_SUCCESS;
|
||||
|
|
@ -12350,6 +12354,12 @@ named_server_freeze(named_server_t *server, bool freeze, isc_lex_t *lex,
|
|||
"Check the logs to see the result.";
|
||||
result = ISC_R_SUCCESS;
|
||||
break;
|
||||
case ISC_R_LOADING:
|
||||
msg = "A zone reload and thaw was already "
|
||||
"in progress.\nCheck the logs to see "
|
||||
"the result.";
|
||||
result = ISC_R_SUCCESS;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,7 +197,8 @@ load_zone(dns_zone_t *zone) {
|
|||
|
||||
result = dns_zone_load(zone, false);
|
||||
if (result != ISC_R_SUCCESS && result != DNS_R_UPTODATE &&
|
||||
result != DNS_R_DYNAMIC && result != DNS_R_CONTINUE)
|
||||
result != DNS_R_DYNAMIC && result != ISC_R_LOADING &&
|
||||
result != DNS_R_CONTINUE)
|
||||
{
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -457,6 +457,7 @@ dns_zone_loadandthaw(dns_zone_t *zone);
|
|||
*\li #ISC_R_UNEXPECTED
|
||||
*\li #ISC_R_SUCCESS
|
||||
*\li DNS_R_CONTINUE Incremental load has been queued.
|
||||
*\li ISC_R_LOADING Load was already in progress.
|
||||
*\li DNS_R_UPTODATE The zone has already been loaded based on
|
||||
* file system timestamps.
|
||||
*\li DNS_R_BADZONE
|
||||
|
|
|
|||
|
|
@ -2434,11 +2434,12 @@ zone_load(dns_zone_t *zone, unsigned int flags, bool locked) {
|
|||
|
||||
INSIST(zone->type != dns_zone_none);
|
||||
|
||||
/* load was already in progress */
|
||||
if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADING)) {
|
||||
if ((flags & DNS_ZONELOADFLAG_THAW) != 0) {
|
||||
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_THAW);
|
||||
}
|
||||
result = DNS_R_CONTINUE;
|
||||
result = ISC_R_LOADING;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
@ -2705,7 +2706,7 @@ zone_asyncload(void *arg) {
|
|||
|
||||
LOCK_ZONE(zone);
|
||||
result = zone_load(zone, asl->flags, true);
|
||||
if (result != DNS_R_CONTINUE) {
|
||||
if (result != DNS_R_CONTINUE && result != ISC_R_LOADING) {
|
||||
DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_LOADPENDING);
|
||||
}
|
||||
UNLOCK_ZONE(zone);
|
||||
|
|
@ -2779,6 +2780,7 @@ dns_zone_loadandthaw(dns_zone_t *zone) {
|
|||
|
||||
switch (result) {
|
||||
case DNS_R_CONTINUE:
|
||||
case ISC_R_LOADING:
|
||||
/* Deferred thaw. */
|
||||
break;
|
||||
case DNS_R_UPTODATE:
|
||||
|
|
|
|||
|
|
@ -286,8 +286,8 @@ static isc_result_t
|
|||
load(dns_zone_t *zone, void *uap) {
|
||||
isc_result_t result;
|
||||
result = dns_zone_load(zone, uap != NULL);
|
||||
if (result == DNS_R_CONTINUE || result == DNS_R_UPTODATE ||
|
||||
result == DNS_R_DYNAMIC)
|
||||
if (result == DNS_R_CONTINUE || result == ISC_R_LOADING ||
|
||||
result == DNS_R_UPTODATE || result == DNS_R_DYNAMIC)
|
||||
{
|
||||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
|
|
@ -448,7 +448,7 @@ freezezones(dns_zone_t *zone, void *uap) {
|
|||
if (frozen) {
|
||||
result = dns_zone_loadandthaw(zone);
|
||||
if (result == DNS_R_CONTINUE ||
|
||||
result == DNS_R_UPTODATE)
|
||||
result == ISC_R_LOADING || result == DNS_R_UPTODATE)
|
||||
{
|
||||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,74 +18,73 @@
|
|||
#include <inttypes.h>
|
||||
|
||||
typedef enum isc_result {
|
||||
ISC_R_SUCCESS, /*%< success */
|
||||
ISC_R_NOMEMORY, /*%< out of memory */
|
||||
ISC_R_TIMEDOUT, /*%< timed out */
|
||||
ISC_R_ADDRNOTAVAIL, /*%< address not available */
|
||||
ISC_R_ADDRINUSE, /*%< address in use */
|
||||
ISC_R_NOPERM, /*%< permission denied */
|
||||
ISC_R_NOCONN, /*%< no pending connections */
|
||||
ISC_R_NETUNREACH, /*%< network unreachable */
|
||||
ISC_R_HOSTUNREACH, /*%< host unreachable */
|
||||
ISC_R_NETDOWN, /*%< network down */
|
||||
ISC_R_HOSTDOWN, /*%< host down */
|
||||
ISC_R_CONNREFUSED, /*%< connection refused */
|
||||
ISC_R_NORESOURCES, /*%< not enough free resources */
|
||||
ISC_R_EOF, /*%< end of file */
|
||||
ISC_R_RELOAD, /*%< reload */
|
||||
ISC_R_SUSPEND = ISC_R_RELOAD, /*%< alias of 'reload' */
|
||||
ISC_R_LOCKBUSY, /*%< lock busy */
|
||||
ISC_R_EXISTS, /*%< already exists */
|
||||
ISC_R_NOSPACE, /*%< ran out of space */
|
||||
ISC_R_CANCELED, /*%< operation canceled */
|
||||
ISC_R_SHUTTINGDOWN, /*%< shutting down */
|
||||
ISC_R_NOTFOUND, /*%< not found */
|
||||
ISC_R_UNEXPECTEDEND, /*%< unexpected end of input */
|
||||
ISC_R_FAILURE, /*%< generic failure */
|
||||
ISC_R_IOERROR, /*%< I/O error */
|
||||
ISC_R_NOTIMPLEMENTED, /*%< not implemented */
|
||||
ISC_R_UNBALANCED, /*%< unbalanced parentheses */
|
||||
ISC_R_NOMORE, /*%< no more */
|
||||
ISC_R_INVALIDFILE, /*%< invalid file */
|
||||
ISC_R_BADBASE64, /*%< bad base64 encoding */
|
||||
ISC_R_UNEXPECTEDTOKEN, /*%< unexpected token */
|
||||
ISC_R_QUOTA, /*%< quota reached */
|
||||
ISC_R_UNEXPECTED, /*%< unexpected error */
|
||||
ISC_R_ALREADYRUNNING, /*%< already running */
|
||||
ISC_R_IGNORE, /*%< ignore */
|
||||
ISC_R_MASKNONCONTIG, /*%< addr mask not contiguous */
|
||||
ISC_R_FILENOTFOUND, /*%< file not found */
|
||||
ISC_R_FILEEXISTS, /*%< file already exists */
|
||||
ISC_R_NOTCONNECTED, /*%< socket is not connected */
|
||||
ISC_R_RANGE, /*%< out of range */
|
||||
ISC_R_NOENTROPY, /*%< out of entropy */
|
||||
ISC_R_MULTICAST, /*%< invalid use of multicast */
|
||||
ISC_R_NOTFILE, /*%< not a file */
|
||||
ISC_R_FAMILYMISMATCH, /*%< address family mismatch */
|
||||
ISC_R_FAMILYNOSUPPORT, /*%< AF not supported */
|
||||
ISC_R_BADHEX, /*%< bad hex encoding */
|
||||
ISC_R_TOOMANYOPENFILES, /*%< too many open files */
|
||||
ISC_R_UNBALANCEDQUOTES, /*%< unbalanced quotes */
|
||||
ISC_R_CONNECTIONRESET, /*%< connection reset */
|
||||
ISC_R_SOFTQUOTA, /*%< soft quota reached */
|
||||
ISC_R_BADNUMBER, /*%< not a valid number */
|
||||
ISC_R_DISABLED, /*%< disabled */
|
||||
ISC_R_MAXSIZE, /*%< max size */
|
||||
ISC_R_BADADDRESSFORM, /*%< invalid address format */
|
||||
ISC_R_BADBASE32, /*%< bad base32 encoding */
|
||||
ISC_R_UNSET, /*%< unset */
|
||||
ISC_R_MULTIPLE, /*%< multiple */
|
||||
ISC_R_COMPLETE, /*%< complete */
|
||||
ISC_R_CRYPTOFAILURE, /*%< cryptography library failure */
|
||||
ISC_R_DISCQUOTA, /*%< disc quota */
|
||||
ISC_R_DISCFULL, /*%< disc full */
|
||||
ISC_R_DEFAULT, /*%< default */
|
||||
ISC_R_IPV4PREFIX, /*%< IPv4 prefix */
|
||||
ISC_R_TLSERROR, /*%< TLS error */
|
||||
ISC_R_TLSBADPEERCERT, /*%< TLS peer certificate verification failed */
|
||||
ISC_R_HTTP2ALPNERROR, /*%< ALPN for HTTP/2 failed */
|
||||
ISC_R_DOTALPNERROR, /*%< ALPN for DoT failed */
|
||||
ISC_R_INVALIDPROTO, /*%< invalid protocol */
|
||||
ISC_R_SUCCESS, /*%< success */
|
||||
ISC_R_NOMEMORY, /*%< out of memory */
|
||||
ISC_R_TIMEDOUT, /*%< timed out */
|
||||
ISC_R_ADDRNOTAVAIL, /*%< address not available */
|
||||
ISC_R_ADDRINUSE, /*%< address in use */
|
||||
ISC_R_NOPERM, /*%< permission denied */
|
||||
ISC_R_NOCONN, /*%< no pending connections */
|
||||
ISC_R_NETUNREACH, /*%< network unreachable */
|
||||
ISC_R_HOSTUNREACH, /*%< host unreachable */
|
||||
ISC_R_NETDOWN, /*%< network down */
|
||||
ISC_R_HOSTDOWN, /*%< host down */
|
||||
ISC_R_CONNREFUSED, /*%< connection refused */
|
||||
ISC_R_NORESOURCES, /*%< not enough free resources */
|
||||
ISC_R_EOF, /*%< end of file */
|
||||
ISC_R_LOADING, /*%< loading */
|
||||
ISC_R_LOCKBUSY, /*%< lock busy */
|
||||
ISC_R_EXISTS, /*%< already exists */
|
||||
ISC_R_NOSPACE, /*%< ran out of space */
|
||||
ISC_R_CANCELED, /*%< operation canceled */
|
||||
ISC_R_SHUTTINGDOWN, /*%< shutting down */
|
||||
ISC_R_NOTFOUND, /*%< not found */
|
||||
ISC_R_UNEXPECTEDEND, /*%< unexpected end of input */
|
||||
ISC_R_FAILURE, /*%< generic failure */
|
||||
ISC_R_IOERROR, /*%< I/O error */
|
||||
ISC_R_NOTIMPLEMENTED, /*%< not implemented */
|
||||
ISC_R_UNBALANCED, /*%< unbalanced parentheses */
|
||||
ISC_R_NOMORE, /*%< no more */
|
||||
ISC_R_INVALIDFILE, /*%< invalid file */
|
||||
ISC_R_BADBASE64, /*%< bad base64 encoding */
|
||||
ISC_R_UNEXPECTEDTOKEN, /*%< unexpected token */
|
||||
ISC_R_QUOTA, /*%< quota reached */
|
||||
ISC_R_UNEXPECTED, /*%< unexpected error */
|
||||
ISC_R_ALREADYRUNNING, /*%< already running */
|
||||
ISC_R_IGNORE, /*%< ignore */
|
||||
ISC_R_MASKNONCONTIG, /*%< addr mask not contiguous */
|
||||
ISC_R_FILENOTFOUND, /*%< file not found */
|
||||
ISC_R_FILEEXISTS, /*%< file already exists */
|
||||
ISC_R_NOTCONNECTED, /*%< socket is not connected */
|
||||
ISC_R_RANGE, /*%< out of range */
|
||||
ISC_R_NOENTROPY, /*%< out of entropy */
|
||||
ISC_R_MULTICAST, /*%< invalid use of multicast */
|
||||
ISC_R_NOTFILE, /*%< not a file */
|
||||
ISC_R_FAMILYMISMATCH, /*%< address family mismatch */
|
||||
ISC_R_FAMILYNOSUPPORT, /*%< AF not supported */
|
||||
ISC_R_BADHEX, /*%< bad hex encoding */
|
||||
ISC_R_TOOMANYOPENFILES, /*%< too many open files */
|
||||
ISC_R_UNBALANCEDQUOTES, /*%< unbalanced quotes */
|
||||
ISC_R_CONNECTIONRESET, /*%< connection reset */
|
||||
ISC_R_SOFTQUOTA, /*%< soft quota reached */
|
||||
ISC_R_BADNUMBER, /*%< not a valid number */
|
||||
ISC_R_DISABLED, /*%< disabled */
|
||||
ISC_R_MAXSIZE, /*%< max size */
|
||||
ISC_R_BADADDRESSFORM, /*%< invalid address format */
|
||||
ISC_R_BADBASE32, /*%< bad base32 encoding */
|
||||
ISC_R_UNSET, /*%< unset */
|
||||
ISC_R_MULTIPLE, /*%< multiple */
|
||||
ISC_R_COMPLETE, /*%< complete */
|
||||
ISC_R_CRYPTOFAILURE, /*%< cryptography library failure */
|
||||
ISC_R_DISCQUOTA, /*%< disc quota */
|
||||
ISC_R_DISCFULL, /*%< disc full */
|
||||
ISC_R_DEFAULT, /*%< default */
|
||||
ISC_R_IPV4PREFIX, /*%< IPv4 prefix */
|
||||
ISC_R_TLSERROR, /*%< TLS error */
|
||||
ISC_R_TLSBADPEERCERT, /*%< TLS peer certificate verification failed */
|
||||
ISC_R_HTTP2ALPNERROR, /*%< ALPN for HTTP/2 failed */
|
||||
ISC_R_DOTALPNERROR, /*%< ALPN for DoT failed */
|
||||
ISC_R_INVALIDPROTO, /*%< invalid protocol */
|
||||
|
||||
DNS_R_LABELTOOLONG,
|
||||
DNS_R_BADESCAPE,
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ static const char *description[ISC_R_NRESULTS] = {
|
|||
[ISC_R_CONNREFUSED] = "connection refused",
|
||||
[ISC_R_NORESOURCES] = "not enough free resources",
|
||||
[ISC_R_EOF] = "end of file",
|
||||
[ISC_R_RELOAD] = "reload",
|
||||
[ISC_R_LOADING] = "loading",
|
||||
[ISC_R_LOCKBUSY] = "lock busy",
|
||||
[ISC_R_EXISTS] = "already exists",
|
||||
[ISC_R_NOSPACE] = "ran out of space",
|
||||
|
|
@ -268,7 +268,7 @@ static const char *identifier[ISC_R_NRESULTS] = {
|
|||
[ISC_R_CONNREFUSED] = "ISC_R_CONNREFUSED",
|
||||
[ISC_R_NORESOURCES] = "ISC_R_NORESOURCES",
|
||||
[ISC_R_EOF] = "ISC_R_EOF",
|
||||
[ISC_R_RELOAD] = "ISC_R_RELOAD",
|
||||
[ISC_R_LOADING] = "ISC_R_LOADING",
|
||||
[ISC_R_LOCKBUSY] = "ISC_R_LOCKBUSY",
|
||||
[ISC_R_EXISTS] = "ISC_R_EXISTS",
|
||||
[ISC_R_NOSPACE] = "ISC_R_NOSPACE",
|
||||
|
|
|
|||
Loading…
Reference in a new issue