Merge branch '2.3' of github.com:mariadb-corporation/MaxScale into 2.3
This commit is contained in:
commit
444c120101
@ -83,7 +83,7 @@ endif()
|
||||
|
||||
# Using initial-exec instead of the default global-dynamic tls-model
|
||||
# reduces the cost of using thread-local variables in dynamic libraries.
|
||||
target_compile_options(maxscale-common PUBLIC "-ftls-model=initial-exec")
|
||||
target_compile_options(maxscale-common PRIVATE "-ftls-model=initial-exec")
|
||||
|
||||
add_dependencies(maxscale-common pcre2 connector-c libmicrohttpd jansson maxbase)
|
||||
set_target_properties(maxscale-common PROPERTIES VERSION "1.0.0")
|
||||
|
@ -47,7 +47,7 @@ Backend::~Backend()
|
||||
|
||||
void Backend::close(close_type type)
|
||||
{
|
||||
mxb_assert(m_dcb->n_close == 0);
|
||||
mxb_assert(m_dcb && m_dcb->n_close == 0);
|
||||
|
||||
if (!m_closed)
|
||||
{
|
||||
@ -180,7 +180,7 @@ void Backend::set_state(backend_state state)
|
||||
|
||||
bool Backend::connect(MXS_SESSION* session, SessionCommandList* sescmd)
|
||||
{
|
||||
mxb_assert(!in_use());
|
||||
mxb_assert(!in_use() && m_dcb == nullptr);
|
||||
bool rval = false;
|
||||
|
||||
if ((m_dcb = dcb_connect(m_backend->server, session, m_backend->server->protocol)))
|
||||
|
@ -4954,36 +4954,6 @@ MXS_CONFIG_PARAMETER* ParamList::params()
|
||||
}
|
||||
}
|
||||
|
||||
void dump_if_changed(const MXS_MODULE_PARAM* params,
|
||||
int file,
|
||||
const std::string& key,
|
||||
const std::string& value)
|
||||
{
|
||||
for (int i = 0; params[i].name; i++)
|
||||
{
|
||||
if (params[i].name == key)
|
||||
{
|
||||
/**
|
||||
* This detects only exact matches, not ones that are logically equivalent
|
||||
* but lexicographically different e.g. 1 and true. This might not
|
||||
* be a bad thing: it'll distinct user defined values from defaults.
|
||||
*/
|
||||
|
||||
if (!params[i].default_value || value != params[i].default_value)
|
||||
{
|
||||
if (dprintf(file, "%s=%s\n", key.c_str(), value.c_str()) == -1)
|
||||
{
|
||||
MXS_ERROR("Failed to serialize service value: %d, %s",
|
||||
errno,
|
||||
mxs_strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dump_param_list(int file,
|
||||
MXS_CONFIG_PARAMETER* list,
|
||||
const std::unordered_set<std::string>& ignored,
|
||||
@ -4994,8 +4964,10 @@ void dump_param_list(int file,
|
||||
{
|
||||
if (ignored.count(p->name) == 0 && *p->value)
|
||||
{
|
||||
dump_if_changed(common_params, file, p->name, p->value);
|
||||
dump_if_changed(module_params, file, p->name, p->value);
|
||||
if (dprintf(file, "%s=%s\n", p->name, p->value) == -1)
|
||||
{
|
||||
MXS_ERROR("Failed to serialize service value: %d, %s", errno, mxs_strerror(errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2041,8 +2041,7 @@ static void dcb_hangup_foreach_worker(MXB_WORKER* worker, struct server* server)
|
||||
|
||||
for (DCB* dcb = this_unit.all_dcbs[id]; dcb; dcb = dcb->thread.next)
|
||||
{
|
||||
if (dcb->state == DCB_STATE_POLLING && dcb->server
|
||||
&& dcb->server == server)
|
||||
if (dcb->state == DCB_STATE_POLLING && dcb->server && dcb->server == server && dcb->n_close == 0)
|
||||
{
|
||||
dcb->flags |= DCBF_HUNG;
|
||||
dcb->func.hangup(dcb);
|
||||
|
@ -540,12 +540,13 @@ static bool create_filter_config(const SFilterDef& filter, const char* filename)
|
||||
|
||||
dprintf(file, "[%s]\n", filter->name.c_str());
|
||||
dprintf(file, "%s=%s\n", CN_TYPE, CN_FILTER);
|
||||
dprintf(file, "%s=%s\n", CN_MODULE, filter->module.c_str());
|
||||
|
||||
const MXS_MODULE* mod = get_module(filter->module.c_str(), NULL);
|
||||
mxb_assert(mod);
|
||||
|
||||
MXS_MODULE_PARAM no_common_params = {};
|
||||
dump_param_list(file, filter->parameters, {CN_TYPE}, &no_common_params, mod->parameters);
|
||||
dump_param_list(file, filter->parameters, {CN_TYPE, CN_MODULE}, &no_common_params, mod->parameters);
|
||||
close(file);
|
||||
|
||||
return true;
|
||||
|
@ -1354,6 +1354,7 @@ static int gw_error_backend_event(DCB* dcb)
|
||||
*/
|
||||
static int gw_backend_hangup(DCB* dcb)
|
||||
{
|
||||
mxb_assert(dcb->n_close == 0);
|
||||
MXS_SESSION* session = dcb->session;
|
||||
|
||||
if (dcb->persistentstart)
|
||||
|
Loading…
x
Reference in New Issue
Block a user