From b9cb29076fbe196013f4e7f080395555d13e9586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 10 Feb 2022 09:21:26 +0100 Subject: [PATCH 1/2] Log when starting and ending task exclusive mode The task exclusive mode stops all processing (tasks and networking IO) except the designated exclusive task events. This has impact on the operation of the server. Add log messages indicating when we start the exclusive mode, and when we end exclusive task mode. --- lib/isc/task.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/isc/task.c b/lib/isc/task.c index d0f9d9be38..666eb13fb2 100644 --- a/lib/isc/task.c +++ b/lib/isc/task.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1107,8 +1108,20 @@ isc_task_beginexclusive(isc_task_t *task) { return (ISC_R_LOCKBUSY); } + if (isc_log_wouldlog(isc_lctx, ISC_LOG_DEBUG(1))) { + isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, + ISC_LOGMODULE_OTHER, ISC_LOG_DEBUG(1), + "exclusive task mode: %s", "starting"); + } + isc_nm_pause(manager->netmgr); + if (isc_log_wouldlog(isc_lctx, ISC_LOG_DEBUG(1))) { + isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, + ISC_LOGMODULE_OTHER, ISC_LOG_DEBUG(1), + "exclusive task mode: %s", "started"); + } + return (ISC_R_SUCCESS); } @@ -1120,7 +1133,20 @@ isc_task_endexclusive(isc_task_t *task) { REQUIRE(task->state == task_state_running); manager = task->manager; + if (isc_log_wouldlog(isc_lctx, ISC_LOG_DEBUG(1))) { + isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, + ISC_LOGMODULE_OTHER, ISC_LOG_DEBUG(1), + "exclusive task mode: %s", "ending"); + } + isc_nm_resume(manager->netmgr); + + if (isc_log_wouldlog(isc_lctx, ISC_LOG_DEBUG(1))) { + isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL, + ISC_LOGMODULE_OTHER, ISC_LOG_DEBUG(1), + "exclusive task mode: %s", "ended"); + } + REQUIRE(atomic_compare_exchange_strong(&manager->exclusive_req, &(bool){ true }, false)); } From 44aa8ef9979366bd5bc78c10ac8557295a3cc1cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 10 Feb 2022 09:30:26 +0100 Subject: [PATCH 2/2] Add CHANGES and release note for [GL #3137] --- CHANGES | 3 +++ doc/notes/notes-current.rst | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index d0dfc2a36f..86eb70b374 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5804. [func] Add a debug log message when starting and ending + the task exclusive mode. [GL #3137] + 5803. [func] Use compile-time paths in the documentation. [GL #2717] diff --git a/doc/notes/notes-current.rst b/doc/notes/notes-current.rst index f5abcd8a83..ded784f7a7 100644 --- a/doc/notes/notes-current.rst +++ b/doc/notes/notes-current.rst @@ -41,6 +41,11 @@ Feature Changes by a client are now included in the client information sent to DLZ modules when processing queries. :gl:`#3082` +- Add DEBUG(1) level messages when starting and ending BIND 9 task exclusive mode + that stops the normal DNS operation (f.e. for reconfiguration, interface + scans, and other events that require exclusive access to a shared resources). + :gl:`#3137` + Bug Fixes ~~~~~~~~~