forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix](thirdparty) patch brpc 1.4.0 to fix stream rpc (apache#30476)
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
thirdparty/patches/brpc-1.4.0-fix-stream-rpc-set-connected.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
From 9acc6ef89d8770d5516953e2eadf0c27a7d424fc Mon Sep 17 00:00:00 2001 | ||
From: Kaijie Chen <[email protected]> | ||
Date: Sun, 28 Jan 2024 15:58:31 +0800 | ||
Subject: [PATCH] fix set connected for stream rpc | ||
|
||
--- | ||
src/brpc/policy/baidu_rpc_protocol.cpp | 11 +++++------ | ||
1 file changed, 5 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/src/brpc/policy/baidu_rpc_protocol.cpp b/src/brpc/policy/baidu_rpc_protocol.cpp | ||
index 0239960e..c47903a6 100644 | ||
--- a/src/brpc/policy/baidu_rpc_protocol.cpp | ||
+++ b/src/brpc/policy/baidu_rpc_protocol.cpp | ||
@@ -234,6 +234,11 @@ void SendRpcResponse(int64_t correlation_id, | ||
// Send rpc response over stream even if server side failed to create | ||
// stream for some reasons. | ||
if(cntl->has_remote_stream()){ | ||
+ if(stream_ptr) { | ||
+ // Now it's ok the mark this server-side stream as connectted as all the | ||
+ // written user data would follower the RPC response. | ||
+ ((Stream*)stream_ptr->conn())->SetConnected(); | ||
+ } | ||
// Send the response over stream to notify that this stream connection | ||
// is successfully built. | ||
// Response_stream can be INVALID_STREAM_ID when error occurs. | ||
@@ -249,12 +254,6 @@ void SendRpcResponse(int64_t correlation_id, | ||
} | ||
return; | ||
} | ||
- | ||
- if(stream_ptr) { | ||
- // Now it's ok the mark this server-side stream as connectted as all the | ||
- // written user data would follower the RPC response. | ||
- ((Stream*)stream_ptr->conn())->SetConnected(); | ||
- } | ||
} else{ | ||
// Have the risk of unlimited pending responses, in which case, tell | ||
// users to set max_concurrency. | ||
-- | ||
2.39.3 | ||
|