]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Log when starting and ending task exclusive mode
authorOndřej Surý <ondrej@isc.org>
Thu, 10 Feb 2022 08:21:26 +0000 (09:21 +0100)
committerOndřej Surý <ondrej@isc.org>
Thu, 10 Feb 2022 20:22:46 +0000 (21:22 +0100)
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.

(cherry picked from commit b9cb29076fbe196013f4e7f080395555d13e9586)

lib/isc/task.c

index e940018d751a8ddc733cf7f5c2fcb6c930651ade..81272efd2ac5f82f799013f555aee6d9305a6cf1 100644 (file)
@@ -25,6 +25,7 @@
 #include <isc/atomic.h>
 #include <isc/condition.h>
 #include <isc/event.h>
+#include <isc/log.h>
 #include <isc/magic.h>
 #include <isc/mem.h>
 #include <isc/once.h>
@@ -1153,8 +1154,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);
 }
 
@@ -1166,7 +1179,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));
 }