372046933 commented on issue #2265:
URL: https://github.com/apache/brpc/issues/2265#issuecomment-1651246342
```
I0726 16:25:12.445185 1011 external/brpc/src/brpc/input_messenger.cpp:116]
cur_index=1 preferred=1 result.error()=1 result.error_str()=try other protocols
I0726 16:25:12.445248 1011 external/brpc/src/brpc/input_messenger.cpp:116]
cur_index=2 preferred=1 result.error()=1 result.error_str()=try other protocols
E0726 16:25:12.445270 1011 external/brpc/src/brpc/input_messenger.cpp:126]
Fail to parse response from 10.156.15.16:20493 by baidu_std at client-side
W0726 16:25:12.445318 1011 external/brpc/src/brpc/input_messenger.cpp:251]
Close Socket{id=8589934619 fd=1341 addr=10.156.15.16:20493:64774}
(0x556c6752fcc0): absolutely wrong message
```
```patch
diff --git a/src/brpc/input_messenger.cpp b/src/brpc/input_messenger.cpp
index 43167d5b..787fc993 100644
--- a/src/brpc/input_messenger.cpp
+++ b/src/brpc/input_messenger.cpp
@@ -113,7 +113,11 @@ ParseResult InputMessenger::CutInputMessage(
}
if (m->CreatedByConnect()) {
- if((ProtocolType)cur_index == PROTOCOL_BAIDU_STD) {
+ LOG(INFO) << "cur_index=" << cur_index
+ << " preferred=" << preferred
+ << " result.error()=" << result.error()
+ << " result.error_str()=" << result.error_str();
+ if ((ProtocolType)cur_index == PROTOCOL_BAIDU_STD) {
// baidu_std may fall to streaming_rpc.
cur_index = (int)PROTOCOL_STREAMING_RPC;
continue;
@@ -332,7 +336,7 @@ void InputMessenger::OnNewMessages(Socket* m) {
// - If the socket has only one message, the message will be parsed and
// processed in this bthread. nova-pbrpc and http works in this way.
// - If the socket has several messages, all messages will be parsed (
- // meaning cutting from butil::IOBuf. serializing from protobuf is
part of
+ // meaning cutting from butil::IOBuf. Deserializing from protobuf is
part of
// "process") in this bthread. All messages except the last one will
be
// processed in separate bthreads. To minimize the overhead,
scheduling
// is batched(notice the BTHREAD_NOSIGNAL and bthread_flush).
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]