yangyang233333 opened a new issue, #2826:
URL: https://github.com/apache/brpc/issues/2826

   **Describe the bug (描述bug)**
   我们使用systemd来守护进程,并且设置了开机自启动进程。但是在线上会随机的出现:
   brpc_server_.Start("ip:8686", &options) 
执行成功时(返回值为0),但是对应的8686端口却无法被访问。(700台机器,偶然出现)。详细代码如下:
   ```c++
     brpc::ServerOptions options;
     options.num_threads = common::FLAGS_brpc_num_threads;
     bthread::FLAGS_bthread_concurrency = 
common::FLAGS_brpc_bthread_concurrency;
     butil::EndPoint endpoint;
     butil::str2endpoint(endpoint_.c_str(), &endpoint);
     // Add controller service
     controller_service_.Init(file_store_);
     auto controller_services = service::ControllerMapToString();
     if (brpc_server_.AddService(&controller_service_, 
brpc::SERVER_DOESNT_OWN_SERVICE,
                                 controller_services) != 0) {
       return {common::START_FAIL, "Http service add failed"};
     }
     if (brpc_server_.Start(endpoint, &options) != 0) {
       LOG(ERROR) << "Brpc server start failed";
       return common::Status(common::START_FAIL, "Brpc server start failed");
     }
   ```
   
   **To Reproduce (复现方法)**
   假设brpc 
server进程为A,使用systemd守护进程A,然后机器重启后,systemd自动拉起A,此时A中的brpc_server_.Start(endpoint,
 &options)返回0表示执行成功,但是对应的8686端口未成功监听。
   
   
   **Versions (各种版本)**
   OS: debain 10 
   Compiler: gcc 9.3
   brpc: 1.7.0
   protobuf: libprotoc 3.6.1
   
   **Additional context/screenshots (更多上下文/截图)**
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to