MS-462 Run milvus server twices, should display error

Former-commit-id: 5d9e7b62470cf48ba84d7be358b0f277268fa831
pull/191/head
Yu Kun 2019-09-02 20:28:01 +08:00
parent abb1979f0c
commit 5857d8163e
2 changed files with 13 additions and 0 deletions

View File

@ -19,6 +19,7 @@ Please mark all change in change log and use the ticket from JIRA.
- MS-436 - Delete vectors failed if index created with index_type: IVF_FLAT/IVF_SQ8
- MS-450 - server hang after run stop_server.sh
- MS-449 - Add vectors twice success, once with ids, the other no ids
- MS-462 - Run milvus server twices, should display error
## Improvement
- MS-327 - Clean code for milvus

View File

@ -34,6 +34,17 @@ static std::unique_ptr<::grpc::Server> server;
constexpr long MESSAGE_SIZE = -1;
class NoReusePortOption : public ::grpc::ServerBuilderOption {
public:
void UpdateArguments(::grpc::ChannelArguments* args) override {
args->SetInt(GRPC_ARG_ALLOW_REUSEPORT, 0);
}
void UpdatePlugins(std::vector<std::unique_ptr<::grpc::ServerBuilderPlugin>>*
plugins) override {}
};
void
GrpcMilvusServer::StartService() {
if (server != nullptr) {
@ -52,6 +63,7 @@ GrpcMilvusServer::StartService() {
std::string server_address(address + ":" + std::to_string(port));
::grpc::ServerBuilder builder;
builder.SetOption(std::unique_ptr<::grpc::ServerBuilderOption>(new NoReusePortOption));
builder.SetMaxReceiveMessageSize(MESSAGE_SIZE); //default 4 * 1024 * 1024
builder.SetMaxSendMessageSize(MESSAGE_SIZE);