Detect double monitoring of servers
Adding a server to multiple monitors is forbidden. This should be detected and reported to the end user. The information provided by the config_runtime system to the client isn't as detailed as it could be. Some sort of an error message stack should be added so that client facing interfaces could properly report the reason for the failure. Currently the only way to detect the reason of the failure is to parse the log files.
This commit is contained in:
@ -768,15 +768,17 @@ static SERVER_REF* server_ref_create(SERVER *server)
|
||||
* @param service The service to add the server to
|
||||
* @param server The server to add
|
||||
*/
|
||||
void
|
||||
serviceAddBackend(SERVICE *service, SERVER *server)
|
||||
bool serviceAddBackend(SERVICE *service, SERVER *server)
|
||||
{
|
||||
bool rval = false;
|
||||
|
||||
if (!serviceHasBackend(service, server))
|
||||
{
|
||||
SERVER_REF *new_ref = server_ref_create(server);
|
||||
|
||||
if (new_ref)
|
||||
{
|
||||
rval = true;
|
||||
spinlock_acquire(&service->spin);
|
||||
|
||||
service->n_dbref++;
|
||||
@ -816,6 +818,8 @@ serviceAddBackend(SERVICE *service, SERVER *server)
|
||||
spinlock_release(&service->spin);
|
||||
}
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user