mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
fix GrpcServer out-of-bounds bug (#7995)
Co-authored-by: 灵洵 <fengbin.ffb@antfin.com>
This commit is contained in:
parent
d985d7537e
commit
026abb119c
1 changed files with 2 additions and 2 deletions
|
@ -24,7 +24,7 @@ namespace rpc {
|
||||||
|
|
||||||
GrpcServer::GrpcServer(std::string name, const uint32_t port, int num_threads)
|
GrpcServer::GrpcServer(std::string name, const uint32_t port, int num_threads)
|
||||||
: name_(std::move(name)), port_(port), is_closed_(true), num_threads_(num_threads) {
|
: name_(std::move(name)), port_(port), is_closed_(true), num_threads_(num_threads) {
|
||||||
cqs_.reserve(num_threads_);
|
cqs_.resize(num_threads_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GrpcServer::Run() {
|
void GrpcServer::Run() {
|
||||||
|
@ -52,7 +52,7 @@ void GrpcServer::Run() {
|
||||||
// Get hold of the completion queue used for the asynchronous communication
|
// Get hold of the completion queue used for the asynchronous communication
|
||||||
// with the gRPC runtime.
|
// with the gRPC runtime.
|
||||||
for (int i = 0; i < num_threads_; i++) {
|
for (int i = 0; i < num_threads_; i++) {
|
||||||
cqs_.push_back(builder.AddCompletionQueue());
|
cqs_[i] = builder.AddCompletionQueue();
|
||||||
}
|
}
|
||||||
// Build and start server.
|
// Build and start server.
|
||||||
server_ = builder.BuildAndStart();
|
server_ = builder.BuildAndStart();
|
||||||
|
|
Loading…
Add table
Reference in a new issue