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 2022/09/29 12:36:54 UTC
[GitHub] [incubator-brpc] ehds opened a new pull request, #1938: fix(rpc_replay) continue when failed to init channel
ehds opened a new pull request, #1938:
URL: https://github.com/apache/incubator-brpc/pull/1938
`ChannelGroup` 初始化时,即使有channel Init 失败时(预期行为)应该直接 continue, 而不是返回 -1。 否则会导致程序直接退出,无法继续向下执行。
--
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-unsubscribe@brpc.apache.org
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] ehds commented on a diff in pull request #1938: fix(rpc_replay) continue when failed to init channel
Posted by GitBox <gi...@apache.org>.
ehds commented on code in PR #1938:
URL: https://github.com/apache/incubator-brpc/pull/1938#discussion_r985032961
##########
tools/rpc_replay/rpc_replay.cpp:
##########
@@ -83,7 +83,9 @@ int ChannelGroup::Init() {
_chans.resize(max_protocol_size + 1);
for (size_t i = 0; i < protocols.size(); ++i) {
if (protocols[i].second.support_client() &&
- protocols[i].second.support_server()) {
+ protocols[i].second.support_server() &&
+ (brpc::StringToConnectionType(FLAGS_connection_type) &
Review Comment:
目前是把 `ChannelOptions` 的初始化放到判断之前,方便用于判断 `connection_type` 和 protocol 的支持关系。如果`connection_type` 为 `CONNECTION_TYPE_UNKNOWN` 或者 `protocol` 支持用户指定的 `connection_type` 才继续往下。这里没有判断 `connection_type `是否` has_error`(用户输入非法的 `connection_type`),因为 InitChannelOptions 中会根据协议支持的 protoctol connection_type 进行选择。
--
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-unsubscribe@brpc.apache.org
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] serverglen commented on pull request #1938: fix(rpc_replay) continue when failed to init channel
Posted by GitBox <gi...@apache.org>.
serverglen commented on PR #1938:
URL: https://github.com/apache/incubator-brpc/pull/1938#issuecomment-1263136591
LGTM
--
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-unsubscribe@brpc.apache.org
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] ehds commented on a diff in pull request #1938: fix(rpc_replay) continue when failed to init channel
Posted by GitBox <gi...@apache.org>.
ehds commented on code in PR #1938:
URL: https://github.com/apache/incubator-brpc/pull/1938#discussion_r984432360
##########
tools/rpc_replay/rpc_replay.cpp:
##########
@@ -93,8 +93,8 @@ int ChannelGroup::Init() {
options.max_retry = FLAGS_max_retry;
if (chan->Init(FLAGS_server.c_str(), FLAGS_load_balancer.c_str(),
&options) != 0) {
- LOG(ERROR) << "Fail to initialize channel";
- return -1;
+ LOG(WARNING) << "Fail to initialize channel";
Review Comment:
done
--
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-unsubscribe@brpc.apache.org
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] wwbmmm commented on a diff in pull request #1938: fix(rpc_replay) continue when failed to init channel
Posted by GitBox <gi...@apache.org>.
wwbmmm commented on code in PR #1938:
URL: https://github.com/apache/incubator-brpc/pull/1938#discussion_r984249708
##########
tools/rpc_replay/rpc_replay.cpp:
##########
@@ -93,8 +93,8 @@ int ChannelGroup::Init() {
options.max_retry = FLAGS_max_retry;
if (chan->Init(FLAGS_server.c_str(), FLAGS_load_balancer.c_str(),
&options) != 0) {
- LOG(ERROR) << "Fail to initialize channel";
- return -1;
+ LOG(WARNING) << "Fail to initialize channel";
Review Comment:
能否先比较protocols[i].second.supported_connection_type和FLAGS_connection_type,遇到不支持的直接跳过呢。
这里Channel::Init失败可能有其它原因,比如FLAGS_server或FLAGS_load_balancer配错,这种情况如果继续往下走就不合适了
--
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-unsubscribe@brpc.apache.org
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] ehds commented on a diff in pull request #1938: fix(rpc_replay) continue when failed to init channel
Posted by GitBox <gi...@apache.org>.
ehds commented on code in PR #1938:
URL: https://github.com/apache/incubator-brpc/pull/1938#discussion_r985032961
##########
tools/rpc_replay/rpc_replay.cpp:
##########
@@ -83,7 +83,9 @@ int ChannelGroup::Init() {
_chans.resize(max_protocol_size + 1);
for (size_t i = 0; i < protocols.size(); ++i) {
if (protocols[i].second.support_client() &&
- protocols[i].second.support_server()) {
+ protocols[i].second.support_server() &&
+ (brpc::StringToConnectionType(FLAGS_connection_type) &
Review Comment:
目前是把 `ChannelOptions` 的初始化放到判断之前,方便用于判断 `connection_type` 和 `protocol` 的支持关系。如果`connection_type` 为 `CONNECTION_TYPE_UNKNOWN` 或者 `protocol` 支持用户指定的 `connection_type` 才继续往下。这里没有判断 `connection_type `是否` has_error`(用户输入非法的 `connection_type`),因为 InitChannelOptions 中会根据协议支持的 protoctol connection_type 进行选择。
--
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-unsubscribe@brpc.apache.org
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] wwbmmm commented on a diff in pull request #1938: fix(rpc_replay) continue when failed to init channel
Posted by GitBox <gi...@apache.org>.
wwbmmm commented on code in PR #1938:
URL: https://github.com/apache/incubator-brpc/pull/1938#discussion_r984442123
##########
tools/rpc_replay/rpc_replay.cpp:
##########
@@ -83,7 +83,9 @@ int ChannelGroup::Init() {
_chans.resize(max_protocol_size + 1);
for (size_t i = 0; i < protocols.size(); ++i) {
if (protocols[i].second.support_client() &&
- protocols[i].second.support_server()) {
+ protocols[i].second.support_server() &&
+ (brpc::StringToConnectionType(FLAGS_connection_type) &
Review Comment:
brpc::StringToConnectionType可能返回CONNECTION_TYPE_UNKNOWN,需要处理下这种情况
--
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-unsubscribe@brpc.apache.org
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] wwbmmm merged pull request #1938: fix(rpc_replay) continue when failed to init channel
Posted by GitBox <gi...@apache.org>.
wwbmmm merged PR #1938:
URL: https://github.com/apache/incubator-brpc/pull/1938
--
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-unsubscribe@brpc.apache.org
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