Unverified Commit 4941431b authored by jamesge's avatar jamesge Committed by GitHub

Merge pull request #1161 from heyuyi0906/fix_h2_req_check_failed

fix h2_req check failed when retry after ELIMIT error
parents e9f6a58f 4f92e064
......@@ -464,6 +464,15 @@ void Channel::CallMethod(const google::protobuf::MethodDescriptor* method,
// Share the lb with controller.
cntl->_lb = _lb;
// Ensure that serialize_request is done before pack_request in all
// possible executions, including:
// HandleSendFailed => OnVersionedRPCReturned => IssueRPC(pack_request)
_serialize_request(&cntl->_request_buf, cntl, request);
if (cntl->FailedInline()) {
// Handle failures caused by serialize_request, and these error_codes
// should be excluded from the retry_policy.
return cntl->HandleSendFailed();
}
if (FLAGS_usercode_in_pthread &&
done != NULL &&
TooManyUserCode()) {
......@@ -471,15 +480,6 @@ void Channel::CallMethod(const google::protobuf::MethodDescriptor* method,
"-usercode_in_pthread is on");
return cntl->HandleSendFailed();
}
if (cntl->FailedInline()) {
// probably failed before RPC, not called until all necessary
// parameters in `cntl' are set.
return cntl->HandleSendFailed();
}
_serialize_request(&cntl->_request_buf, cntl, request);
if (cntl->FailedInline()) {
return cntl->HandleSendFailed();
}
if (cntl->_request_stream != INVALID_STREAM_ID) {
// Currently we cannot handle retry and backup request correctly
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment