From: Ondřej Surý Date: Thu, 10 Feb 2022 08:21:26 +0000 (+0100) Subject: Log when starting and ending task exclusive mode X-Git-Tag: v9.19.0~122^2~1 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=b9cb29076fbe196013f4e7f080395555d13e9586;p=thirdparty%2Fbind9.git 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. --- diff --git a/lib/isc/task.c b/lib/isc/task.c index d0f9d9be384..666eb13fb2a 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)); }