MySQL  8.0.19
Source Code Documentation
loader.cc File Reference
#include "mysql/harness/loader.h"
#include <algorithm>
#include <array>
#include <atomic>
#include <cassert>
#include <cctype>
#include <cstdarg>
#include <cstring>
#include <exception>
#include <map>
#include <sstream>
#include <stdexcept>
#include <string>
#include <system_error>
#include <thread>
#include <dlfcn.h>
#include <pthread.h>
#include <unistd.h>
#include "builtin_plugins.h"
#include "common.h"
#include "designator.h"
#include "dim.h"
#include "exception.h"
#include "harness_assert.h"
#include "my_stacktrace.h"
#include "mysql/harness/filesystem.h"
#include "mysql/harness/logging/logging.h"
#include "mysql/harness/logging/registry.h"
#include "mysql/harness/plugin.h"
#include "utilities.h"
#include "my_compiler.h"

Classes

class  mysql_harness::LogReopenThread
 

Namespaces

 mysql_harness
 
 unittest_backdoor
 

Macros

#define MYSQL_ROUTER_LOG_DOMAIN   ::mysql_harness::logging::kMainLogger
 
#define USE_POSIX_SIGNALS
 
#define __has_feature(x)   0
 

Enumerations

enum  ShutdownReason { SHUTDOWN_NONE, SHUTDOWN_REQUESTED, SHUTDOWN_FATAL_ERROR }
 

Functions

static void request_application_shutdown (const ShutdownReason reason)
 request application shutdown. More...
 
void request_application_shutdown ()
 request application shutdown. More...
 
static void request_log_reopen ()
 notify a "log_reopen" is requested. More...
 
static void block_all_nonfatal_signals ()
 
static void register_fatal_signal_handler ()
 
static void start_and_detach_signal_handler_thread ()
 
static void log_reopen_thread_function ()
 
const AppInfo * mysql_harness::get_app_info (const PluginFuncEnv *env) noexcept
 
const ConfigSection * mysql_harness::get_config_section (const PluginFuncEnv *env) noexcept
 
bool mysql_harness::is_running (const PluginFuncEnv *env) noexcept
 
bool mysql_harness::wait_for_stop (const PluginFuncEnv *env, uint32_t milliseconds) noexcept
 
void mysql_harness::clear_running (PluginFuncEnv *env) noexcept
 
void mysql_harness::set_error (PluginFuncEnv *env, ErrorType error_type, const char *fmt,...) noexcept
 
template<class T >
mysql_harness::value_or (T a, T b)
 If a isn't set, return b. More...
 
static void mysql_harness::call_plugin_function (PluginFuncEnv *env, std::exception_ptr &eptr, void(*fptr)(PluginFuncEnv *), const char *fnc_name, const char *plugin_name, const char *plugin_key=nullptr) noexcept
 
HARNESS_EXPORT void unittest_backdoor::set_shutdown_pending (bool shutdown_pending)
 

Variables

std::mutex we_might_shutdown_cond_mutex
 
std::condition_variable we_might_shutdown_cond
 
static std::atomic< ShutdownReasong_shutdown_pending {SHUTDOWN_NONE}
 
static std::string shutdown_fatal_error_message
 
std::mutex log_reopen_cond_mutex
 
std::condition_variable log_reopen_cond
 
static std::atomic< boolg_log_reopen_requested {false}
 

Macro Definition Documentation

◆ __has_feature

#define __has_feature (   x)    0

◆ MYSQL_ROUTER_LOG_DOMAIN

#define MYSQL_ROUTER_LOG_DOMAIN   ::mysql_harness::logging::kMainLogger

◆ USE_POSIX_SIGNALS

#define USE_POSIX_SIGNALS

Enumeration Type Documentation

◆ ShutdownReason

Enumerator
SHUTDOWN_NONE 
SHUTDOWN_REQUESTED 
SHUTDOWN_FATAL_ERROR 

Function Documentation

◆ block_all_nonfatal_signals()

static void block_all_nonfatal_signals ( )
static

◆ log_reopen_thread_function()

static void log_reopen_thread_function ( )
static

◆ register_fatal_signal_handler()

static void register_fatal_signal_handler ( )
static

◆ request_application_shutdown() [1/2]

void request_application_shutdown ( )

request application shutdown.

Exceptions
std::system_errorsame as std::unique_lock::lock does

◆ request_application_shutdown() [2/2]

static void request_application_shutdown ( const ShutdownReason  reason)
static

request application shutdown.

Exceptions
std::system_errorsame as std::unique_lock::lock does

◆ request_log_reopen()

static void request_log_reopen ( )
static

notify a "log_reopen" is requested.

Exceptions
std::system_errorsame as std::unique_lock::lock does

◆ start_and_detach_signal_handler_thread()

static void start_and_detach_signal_handler_thread ( )
static

Variable Documentation

◆ g_log_reopen_requested

std::atomic<bool> g_log_reopen_requested {false}
static

◆ g_shutdown_pending

std::atomic<ShutdownReason> g_shutdown_pending {SHUTDOWN_NONE}
static

◆ log_reopen_cond

std::condition_variable log_reopen_cond

◆ log_reopen_cond_mutex

std::mutex log_reopen_cond_mutex

◆ shutdown_fatal_error_message

std::string shutdown_fatal_error_message
static

◆ we_might_shutdown_cond

std::condition_variable we_might_shutdown_cond

◆ we_might_shutdown_cond_mutex

std::mutex we_might_shutdown_cond_mutex