mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-04 00:25:29 +00:00
isc_loopmgr_pause was called inappropriately
isc_loopmgr_pause can't be called before isc_loopmgr_run is called as the thread ids are not yet valid. If there is a fatal error before isc_loopmgr_run is run then don't call isc_loopmgr_pause.
This commit is contained in:
@@ -53,6 +53,7 @@ EXTERN unsigned int named_g_cpus INIT(0);
|
||||
EXTERN unsigned int named_g_udpdisp INIT(0);
|
||||
EXTERN isc_loop_t *named_g_mainloop INIT(NULL);
|
||||
EXTERN isc_loopmgr_t *named_g_loopmgr INIT(NULL);
|
||||
EXTERN bool named_g_loopmgr_running INIT(false);
|
||||
EXTERN dns_dispatchmgr_t *named_g_dispatchmgr INIT(NULL);
|
||||
EXTERN unsigned int named_g_cpus_detected INIT(1);
|
||||
|
||||
|
@@ -1506,6 +1506,10 @@ main(int argc, char *argv[]) {
|
||||
*/
|
||||
isc_signal_start(named_g_server->sighup);
|
||||
|
||||
/*
|
||||
* Pause the loop manager in fatal.
|
||||
*/
|
||||
named_g_loopmgr_running = true;
|
||||
isc_loopmgr_run(named_g_loopmgr);
|
||||
|
||||
#ifdef HAVE_LIBSCF
|
||||
|
@@ -10286,7 +10286,9 @@ named_server_destroy(named_server_t **serverp) {
|
||||
|
||||
static void
|
||||
fatal(const char *msg, isc_result_t result) {
|
||||
if (named_g_loopmgr_running) {
|
||||
isc_loopmgr_pause(named_g_loopmgr);
|
||||
}
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_SERVER, ISC_LOG_CRITICAL, "%s: %s", msg,
|
||||
isc_result_totext(result));
|
||||
|
Reference in New Issue
Block a user