Merge remote-tracking branch 'upstream/branch-0.3.0' into mysql-0.3.0

Former-commit-id: 5935eae6d401f047e1e75718cae16fdfa5883030
This commit is contained in:
zhiru 2019-06-24 11:26:37 +08:00
commit 25e8ed5362
6 changed files with 31 additions and 30 deletions

View File

@ -5,6 +5,7 @@ Please mark all change in change log and use the ticket from JIRA.
# Milvus 0.3.0 (TBD)
## Bug
- MS-104 - Fix unittest lcov execution error
- MS-102 - Fix build script file condition error
- MS-80 - Fix server hang issue
- MS-89 - Fix compile failed, libgpufaiss.a link missing

View File

@ -84,10 +84,10 @@ if [[ ${BUILD_TYPE} != "Debug" ]]; then
strip src/milvus_server
fi
make install || exit 1
if [[ ${BUILD_COVERAGE} == "ON" ]]; then
cd -
bash `pwd`/coverage.sh
cd -
fi
make install

View File

@ -32,7 +32,7 @@ for test in `ls ${DIR_UNITTEST}`; do
done
# gen test converage
${LCOV_CMD} -d ${DIR_GCNO} -o "${FILE_INFO_MILVUS}" -c -b
${LCOV_CMD} -d ${DIR_GCNO} -o "${FILE_INFO_MILVUS}" -c
# merge coverage
${LCOV_CMD} -a ${FILE_INFO_BASE} -a ${FILE_INFO_MILVUS} -o "${FILE_INFO_OUTPUT}"

View File

@ -47,27 +47,27 @@ LicenseCheck::LegalityCheck(const std::string &license_file_path) {
end_time);
if(err !=SERVER_SUCCESS)
{
printf("License check error: 01\n");
std::cout << "License check error: 01" << std::endl;
return SERVER_UNEXPECTED_ERROR;
}
time_t system_time;
LicenseLibrary::GetSystemTime(system_time);
if (device_count != output_device_count) {
printf("License check error: 02\n");
std::cout << "License check error: 02" << std::endl;
return SERVER_UNEXPECTED_ERROR;
}
for (int i = 0; i < device_count; ++i) {
if (sha_array[i] != uuid_encryption_map[i]) {
printf("License check error: 03\n");
std::cout << "License check error: 03" << std::endl;
return SERVER_UNEXPECTED_ERROR;
}
}
if (system_time < starting_time || system_time > end_time) {
printf("License check error: 04\n");
std::cout << "License check error: 04" << std::endl;
return SERVER_UNEXPECTED_ERROR;
}
printf("Legality Check Success\n");
std::cout << "Legality Check Success" << std::endl;
return SERVER_SUCCESS;
}
@ -80,11 +80,11 @@ LicenseCheck::AlterFile(const std::string &license_file_path,
ServerError err = LicenseCheck::LegalityCheck(license_file_path);
if(err!=SERVER_SUCCESS) {
printf("license file check error\n");
std::cout << "license file check error" << std::endl;
exit(1);
}
printf("---runing---\n");
std::cout << "---runing---" << std::endl;
pt->expires_at(pt->expires_at() + boost::posix_time::hours(1));
pt->async_wait(boost::bind(LicenseCheck::AlterFile, license_file_path, boost::asio::placeholders::error, pt));
@ -96,7 +96,7 @@ ServerError
LicenseCheck::StartCountingDown(const std::string &license_file_path) {
if (!LicenseLibrary::IsFileExistent(license_file_path)) {
printf("license file not exist\n");
std::cout << "license file not exist" << std::endl;
exit(1);
}

View File

@ -26,8 +26,8 @@ using namespace zilliz::milvus;
int
main(int argc, char *argv[]) {
printf("\nWelcome to use Milvus by Zillz!\n");
printf("Milvus %s version: v%s built at %s\n", BUILD_TYPE, MILVUS_VERSION, BUILD_TIME);
std::cout << std::endl << "Welcome to use Milvus by Zillz!" << std::endl;
std::cout << "Milvus " << BUILD_TYPE << " version: v" << MILVUS_VERSION << " built at " << BUILD_TIME << std::endl;
signal(SIGINT, server::SignalUtil::HandleSignal);
signal(SIGSEGV, server::SignalUtil::HandleSignal);
@ -53,7 +53,7 @@ main(int argc, char *argv[]) {
if(argc < 2) {
print_help(app_name);
printf("Milvus server exit...\n");
std::cout << "Milvus server exit..." << std::endl;
return EXIT_FAILURE;
}
@ -64,14 +64,14 @@ main(int argc, char *argv[]) {
char *config_filename_ptr = strdup(optarg);
config_filename = config_filename_ptr;
free(config_filename_ptr);
printf("Loading configuration from: %s\n", config_filename.c_str());
std::cout << "Loading configuration from: " << config_filename << std::endl;
break;
}
case 'l': {
char *log_filename_ptr = strdup(optarg);
log_config_file = log_filename_ptr;
free(log_filename_ptr);
printf("Initial log config from: %s\n", log_config_file.c_str());
std::cout << "Initial log config from: " << log_config_file << std::endl;
break;
}
@ -79,7 +79,7 @@ main(int argc, char *argv[]) {
char *pid_filename_ptr = strdup(optarg);
pid_filename = pid_filename_ptr;
free(pid_filename_ptr);
printf("%s\n", pid_filename.c_str());
std::cout << pid_filename << std::endl;
break;
}
@ -107,11 +107,11 @@ main(int argc, char *argv[]) {
void
print_help(const std::string &app_name) {
printf("\n Usage: %s [OPTIONS]\n\n", app_name.c_str());
printf(" Options:\n");
printf(" -h --help Print this help\n");
printf(" -c --conf_file filename Read configuration from the file\n");
printf(" -d --daemon Daemonize this application\n");
printf(" -p --pid_file filename PID file used by daemonized app\n");
printf("\n");
std::cout << std::endl<< "Usage: " << app_name << " [OPTIONS]" << std::endl << std::endl;
std::cout << " Options:" << std::endl;
std::cout << " -h --help Print this help" << std::endl;
std::cout << " -c --conf_file filename Read configuration from the file" << std::endl;
std::cout << " -d --daemon Daemonize this application" << std::endl;
std::cout << " -p --pid_file filename PID file used by daemonized app" << std::endl;
std::cout << std::endl;
}

View File

@ -171,7 +171,7 @@ Server::Start() {
signal(SIGTERM, SignalUtil::HandleSignal);
server::Metrics::GetInstance().Init();
server::SystemInfo::GetInstance().Init();
printf("Milvus server start successfully.\n");
std::cout << "Milvus server start successfully." << std::endl;
StartService();
} catch(std::exception& ex){
@ -187,18 +187,18 @@ Server::Start() {
void
Server::Stop() {
printf("Milvus server is going to shutdown ...\n");
std::cout << "Milvus server is going to shutdown ..." << std::endl;
// Unlock and close lockfile
if (pid_fd != -1) {
int ret = lockf(pid_fd, F_ULOCK, 0);
if(ret != 0){
printf("Can't lock file: %s\n", strerror(errno));
std::cout << "Can't lock file: " << strerror(errno) << std::endl;
exit(0);
}
ret = close(pid_fd);
if(ret != 0){
printf("Can't close file: %s\n", strerror(errno));
std::cout << "Can't close file: " << strerror(errno) << std::endl;
exit(0);
}
}
@ -207,7 +207,7 @@ Server::Stop() {
if (!pid_filename_.empty()) {
int ret = unlink(pid_filename_.c_str());
if(ret != 0){
printf("Can't unlink file: %s\n", strerror(errno));
std::cout << "Can't unlink file: " << strerror(errno) << std::endl;
exit(0);
}
}
@ -219,7 +219,7 @@ Server::Stop() {
#ifdef ENABLE_LICENSE
server::LicenseCheck::GetInstance().StopCountingDown();
#endif
printf("Milvus server is closed!\n");
std::cout << "Milvus server is closed!" << std::endl;
}