MXS-1929: Make listeners inactive when destroyed

By using service_remove_listener the listener is marked as inactive when
it is destroyed.
This commit is contained in:
Markus Mäkelä
2018-07-18 09:52:10 +03:00
parent 23d944b82e
commit 18c1ec2678

View File

@ -964,30 +964,23 @@ bool runtime_destroy_listener(SERVICE *service, const char *name)
} }
else else
{ {
runtime_error("Listener '%s' was not created at runtime. Remove the listener " runtime_error("Persisted configuration file for listener '%s' was not "
"manually from the correct configuration file.", name); "found. This means that the listener was not created at "
"runtime. Remove the listener manually from the correct "
"configuration file.", name);
} }
} }
else if (!service_remove_listener(service, name))
{
MXS_ERROR("Failed to destroy listener '%s' for service '%s'", name, service->name);
runtime_error("Failed to destroy listener '%s' for service '%s'", name, service->name);
}
else else
{ {
rval = true; rval = true;
} MXS_NOTICE("Destroyed listener '%s' for service '%s'. The listener "
"will be removed after the next restart of MaxScale.",
if (rval) name, service->name);
{
rval = serviceStopListener(service, name);
if (rval)
{
MXS_NOTICE("Destroyed listener '%s' for service '%s'. The listener "
"will be removed after the next restart of MaxScale.",
name, service->name);
}
else
{
MXS_ERROR("Failed to destroy listener '%s' for service '%s'", name, service->name);
runtime_error("Failed to destroy listener '%s' for service '%s'", name, service->name);
}
} }
return rval; return rval;