MXS-22: Shutting down monitor now closes database connections
Shutting down monitors is not supposed to be done ofter so there is no true benefit from keeping the connections open. With the refactoring of the monitor interface, this can be done in a centralized place.
This commit is contained in:
parent
9e33f300b0
commit
4f2a87f732
@ -186,12 +186,22 @@ void monitorStartAll()
|
||||
void
|
||||
monitorStop(MONITOR *monitor)
|
||||
{
|
||||
spinlock_acquire(&monitor->lock);
|
||||
if (monitor->state != MONITOR_STATE_STOPPED)
|
||||
{
|
||||
monitor->state = MONITOR_STATE_STOPPING;
|
||||
monitor->module->stopMonitor(monitor);
|
||||
monitor->state = MONITOR_STATE_STOPPED;
|
||||
|
||||
MONITOR_SERVERS* db = monitor->databases;
|
||||
while (db)
|
||||
{
|
||||
mysql_close(db->con);
|
||||
db->con = NULL;
|
||||
db = db->next;
|
||||
}
|
||||
}
|
||||
spinlock_release(&monitor->lock);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user