@@ -302,26 +302,6 @@ void perform_callbacks(ENGINE_EVENT_TYPE type,
302302 }
303303 break ;
304304 }
305- case ON_LOG_LEVEL:
306- if (void_cookie != nullptr ) {
307- throw std::invalid_argument (" perform_callbacks: cookie "
308- " (which is " +
309- std::to_string (reinterpret_cast <uintptr_t >(void_cookie)) +
310- " ) should be NULL for ON_LOG_LEVEL" );
311- }
312- for (auto & handler : engine_event_handlers[type]) {
313- handler.cb (void_cookie, ON_LOG_LEVEL, data, handler.cb_data );
314- }
315-
316- if (service_online) {
317- // MB-33637: Make the verbosity change in the calling thread.
318- // This should be a relatively quick operation as we only block if
319- // we are registering or unregistering new loggers. It also prevents
320- // a race condition on shutdown where we could attempt to log
321- // something but the logger has already been destroyed.
322- populate_log_level ();
323- }
324- break ;
325305
326306 default :
327307 throw std::invalid_argument (" perform_callbacks: type "
@@ -357,13 +337,6 @@ static void register_callback(EngineIface* eh,
357337 all_buckets[idx].engine_event_handlers [type].push_back ({cb, cb_data});
358338 break ;
359339
360- case ON_LOG_LEVEL:
361- if (eh != nullptr ) {
362- throw std::invalid_argument (" register_callback: 'eh' must be NULL" );
363- }
364- engine_event_handlers[type].push_back ({cb, cb_data});
365- break ;
366-
367340 default :
368341 throw std::invalid_argument (" register_callback: type (which is " +
369342 std::to_string (type) +
@@ -486,7 +459,12 @@ static void verbosity_changed_listener(const std::string&, Settings &s) {
486459 logger->set_level (settings.getLogLevel ());
487460 }
488461
489- perform_callbacks (ON_LOG_LEVEL, nullptr , nullptr );
462+ // MB-33637: Make the verbosity change in the calling thread.
463+ // This should be a relatively quick operation as we only block if
464+ // we are registering or unregistering new loggers. It also prevents
465+ // a race condition on shutdown where we could attempt to log
466+ // something but the logger has already been destroyed.
467+ populate_log_level ();
490468}
491469
492470static void scramsha_fallback_salt_changed_listener (const std::string&,
@@ -2434,8 +2412,8 @@ extern "C" int memcached_main(int argc, char **argv) {
24342412
24352413 initialize_audit ();
24362414
2437- /* inform interested parties of initial verbosity level */
2438- perform_callbacks (ON_LOG_LEVEL, nullptr , nullptr );
2415+ // inform interested parties of initial verbosity level
2416+ populate_log_level ( );
24392417
24402418 recalculate_max_connections ();
24412419
0 commit comments