Prevent object deletion on shutdown when checking !IsActive()

This is fairly ugly and sets an extension for the ConfigObjectUtility
delete handler to signal the OnActiveChanged handler inside the cluster
configsync to send a delete event to the other nodes.

refs #9927
This commit is contained in:
Michael Friedrich 2015-09-15 17:56:34 +02:00
parent 4955c28b0c
commit 0fd9d3406b
2 changed files with 4 additions and 1 deletions

View File

@ -53,7 +53,7 @@ void ApiListener::ConfigUpdateObjectHandler(const ConfigObject::Ptr& object, con
if (object->IsActive()) {
/* Sync object config */
listener->UpdateConfigObject(object, cookie);
} else {
} else if (!object->IsActive() && object->GetExtension("ConfigObjectDeleted")) {
/* Delete object */
listener->DeleteConfigObject(object, cookie);
}

View File

@ -154,6 +154,9 @@ bool ConfigObjectUtility::DeleteObjectHelper(const ConfigObject::Ptr& object, bo
ConfigItem::Ptr item = ConfigItem::GetByTypeAndName(type->GetName(), object->GetName());
try {
/* mark this object for cluster delete event */
object->SetExtension("ConfigObjectDeleted", true);
/* triggers signal for DB IDO and other interfaces */
object->Deactivate();
if (item)