mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
add more error handling
Former-commit-id: 3039ab0d82bd1414f09c99f4edc4c21cfd6682b9
This commit is contained in:
parent
abe34a4586
commit
69cafce6cf
@ -40,12 +40,16 @@ DBWrapper::DBWrapper() {
|
||||
opt.meta.archive_conf.SetCriterias(criterial);
|
||||
|
||||
//create db root folder
|
||||
CommonUtil::CreateDirectory(opt.meta.path);
|
||||
ServerError err = CommonUtil::CreateDirectory(opt.meta.path);
|
||||
if(err != SERVER_SUCCESS) {
|
||||
std::cout << "ERROR! Failed to create database root path: " << opt.meta.path << std::endl;
|
||||
kill(0, SIGUSR1);
|
||||
}
|
||||
|
||||
zilliz::milvus::engine::DB::Open(opt, &db_);
|
||||
if(db_ == nullptr) {
|
||||
SERVER_LOG_ERROR << "Failed to open db. Provided database uri = " << opt.meta.backend_uri;
|
||||
throw ServerException(SERVER_NULL_POINTER, "Failed to open db");
|
||||
std::cout << "ERROR! Failed to open database" << std::endl;
|
||||
kill(0, SIGUSR1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#include <thrift/concurrency/PosixThreadFactory.h>
|
||||
|
||||
#include <thread>
|
||||
#include <iostream>
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
@ -93,7 +94,8 @@ MilvusServer::StartService() {
|
||||
return;
|
||||
}
|
||||
} catch (apache::thrift::TException& ex) {
|
||||
SERVER_LOG_ERROR << "Server encounter exception: " << ex.what();
|
||||
std::cout << "ERROR! " << ex.what() << std::endl;
|
||||
kill(0, SIGUSR1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user