GH-1426: Improve handling of Broker data store creation failures

Broker::create_master() and Broker::create_clone() now return
a valid value even when there's a failure to open the backend database
(e.g. SQLite filesystem error).  In that case, the returned value can
still be passed into other data store operations, but they'll fail
immediately with an error.  Broker::is_closed() can now also be used to
determine whether the data store creation calls failed.
This commit is contained in:
Jon Siwek 2021-03-05 23:28:57 -08:00
parent 6946cffde2
commit 6af436aad3
8 changed files with 138 additions and 14 deletions

View file

@ -1746,6 +1746,10 @@ bool Manager::CloseStore(const string& name)
++i;
}
s->second->have_store = false;
s->second->store_pid = {};
s->second->proxy = {};
s->second->store = {};
Unref(s->second);
data_stores.erase(s);
return true;