You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2021/01/26 09:26:39 UTC

[GitHub] [incubator-brpc] zgb40302 opened a new issue #1338: reuse_port选项没有生效

zgb40302 opened a new issue #1338:
URL: https://github.com/apache/incubator-brpc/issues/1338


   **Describe the bug (描述bug)**
   reuse_addr 选项没生效
   
   **To Reproduce (复现方法)**
   场景1:
   [root@localhost bin]# ./test --reuse_port=true --reuse_addr=false &
   I0126 17:19:43.666755 14773 /data1/incubator-brpc/src/brpc/server.cpp:1045] Server[Instance] is serving on port=3560.
   I0126 17:19:43.666857 14773 /data1/incubator-brpc/src/brpc/server.cpp:1048] Check out http://localhost.localdomain:35611 in web browser.
   
   [root@localhost bin]# 
   [root@localhost bin]# ./test --reuse_port=true --reuse_addr=false
   E0126 17:19:53.633741 15182 /data1/incubator-brpc/src/brpc/server.cpp:955] Fail to listen 0.0.0.0:3560
   error_msg "Start failed", at test.cpp:237, Address already in use  //  不能重用
   
   场景2:
   [root@localhost bin]# ./test --reuse_port=true &
   I0126 17:10:59.854588 30670 /data1/incubator-brpc/src/brpc/server.cpp:1045] Server[Instance] is serving on port=3560.
   I0126 17:10:59.854727 30670 /data1/incubator-brpc/src/brpc/server.cpp:1048] Check out http://localhost.localdomain:35611 in web browser.
   
   [root@localhost bin]# 
   [root@localhost bin]# ./test --reuse_port=true
   E0126 17:11:08.437747 31051 /data1/incubator-brpc/src/brpc/server.cpp:955] Fail to listen 0.0.0.0:3560
   error_msg "Start failed", at test.cpp:237, Address already in use   //  不能重用
   
   
   **Expected behavior (期望行为)**
   reuse_port可以生效
   
   **Versions (各种版本)**
   OS:    linux 3.10 
   Compiler: gcc
   brpc:    0.9.7
   protobuf:   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.

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



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


[GitHub] [incubator-brpc] zgb40302 commented on issue #1338: reuse_port选项没有生效

Posted by GitBox <gi...@apache.org>.
zgb40302 commented on issue #1338:
URL: https://github.com/apache/incubator-brpc/issues/1338#issuecomment-767521791


   main 函数里没有调用这个函数
   google::ParseCommandLineFlags(&args, &argv, true);
   所以命令行里的reuse_port没有生效


----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-brpc] zgb40302 removed a comment on issue #1338: reuse_port选项没有生效

Posted by GitBox <gi...@apache.org>.
zgb40302 removed a comment on issue #1338:
URL: https://github.com/apache/incubator-brpc/issues/1338#issuecomment-767515539


   example  里面的echo++ 程序没有问题
   [root@localhost build]# ./echo_server --reuse_port=true &
   [1] 23377
   [root@localhost build]# I0126 20:37:08.738100 23377 /data0/data1/incubator-brpc/src/brpc/server.cpp:1045] Server[example::EchoServiceImpl] is serving on port=8000.
   I0126 20:37:08.738689 23377 /data0/data1/incubator-brpc/src/brpc/server.cpp:1048] Check out http://localhost.localdomain:8000 in web browser.
   
   [root@localhost build]# ./echo_server --reuse_port=true
   I0126 20:37:11.704532 23494 /data0/data1/incubator-brpc/src/brpc/server.cpp:1045] Server[example::EchoServiceImpl] is serving on port=8000.
   I0126 20:37:11.705123 23494 /data0/data1/incubator-brpc/src/brpc/server.cpp:1048] Check out http://localhost.localdomain:8000 in web browser.
   
   ^CI0126 20:37:20.231765 23494 /data0/data1/incubator-brpc/src/brpc/server.cpp:1100] Server[example::EchoServiceImpl] is going to quit


----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-brpc] zgb40302 commented on issue #1338: reuse_port选项没有生效

Posted by GitBox <gi...@apache.org>.
zgb40302 commented on issue #1338:
URL: https://github.com/apache/incubator-brpc/issues/1338#issuecomment-767515539


   example  里面的echo++ 程序没有问题


----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-brpc] zgb40302 edited a comment on issue #1338: reuse_port选项没有生效

Posted by GitBox <gi...@apache.org>.
zgb40302 edited a comment on issue #1338:
URL: https://github.com/apache/incubator-brpc/issues/1338#issuecomment-767515539


   example  里面的echo++ 程序没有问题
   [root@localhost build]# ./echo_server --reuse_port=true &
   [1] 23377
   [root@localhost build]# I0126 20:37:08.738100 23377 /data0/data1/incubator-brpc/src/brpc/server.cpp:1045] Server[example::EchoServiceImpl] is serving on port=8000.
   I0126 20:37:08.738689 23377 /data0/data1/incubator-brpc/src/brpc/server.cpp:1048] Check out http://localhost.localdomain:8000 in web browser.
   
   [root@localhost build]# ./echo_server --reuse_port=true
   I0126 20:37:11.704532 23494 /data0/data1/incubator-brpc/src/brpc/server.cpp:1045] Server[example::EchoServiceImpl] is serving on port=8000.
   I0126 20:37:11.705123 23494 /data0/data1/incubator-brpc/src/brpc/server.cpp:1048] Check out http://localhost.localdomain:8000 in web browser.
   
   ^CI0126 20:37:20.231765 23494 /data0/data1/incubator-brpc/src/brpc/server.cpp:1100] Server[example::EchoServiceImpl] is going to quit


----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-brpc] zgb40302 commented on issue #1338: reuse_port选项没有生效

Posted by GitBox <gi...@apache.org>.
zgb40302 commented on issue #1338:
URL: https://github.com/apache/incubator-brpc/issues/1338#issuecomment-767516245


   
   
   example 里面的echo++ 程序没有问题
   [root@localhost build]# ./echo_server --reuse_port=true &
   [1] 23377
   [root@localhost build]# I0126 20:37:08.738100 23377 /data0/data1/incubator-brpc/src/brpc/server.cpp:1045] Server[example::EchoServiceImpl] is serving on port=8000.
   I0126 20:37:08.738689 23377 /data0/data1/incubator-brpc/src/brpc/server.cpp:1048] Check out http://localhost.localdomain:8000 in web browser.
   
   [root@localhost build]# ./echo_server --reuse_port=true
   I0126 20:37:11.704532 23494 /data0/data1/incubator-brpc/src/brpc/server.cpp:1045] Server[example::EchoServiceImpl] is serving on port=8000.
   I0126 20:37:11.705123 23494 /data0/data1/incubator-brpc/src/brpc/server.cpp:1048] Check out http://localhost.localdomain:8000 in web browser.
   
   ^CI0126 20:37:20.231765 23494 /data0/data1/incubator-brpc/src/brpc/server.cpp:1100] Server[example::EchoServiceImpl] is going to quit


----------------------------------------------------------------
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.

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



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


[GitHub] [incubator-brpc] zgb40302 closed issue #1338: reuse_port选项没有生效

Posted by GitBox <gi...@apache.org>.
zgb40302 closed issue #1338:
URL: https://github.com/apache/incubator-brpc/issues/1338


   


----------------------------------------------------------------
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.

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



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