You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by lo...@apache.org on 2022/07/19 18:59:57 UTC

[incubator-brpc] branch master updated: Fix stream will respond received feedback frame with RST frame when closed

This is an automated email from the ASF dual-hosted git repository.

lorinlee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 7c710511 Fix stream will respond received feedback frame with RST frame when closed
     new a6de1a98 Merge pull request #1826 from jenrryyou/fix_stream_feedback_will_send_rst
7c710511 is described below

commit 7c7105113ba232a5fb22dad0fa50648dba2d49e2
Author: youzhiyuan <yo...@bytedance.com>
AuthorDate: Sun Jul 3 09:29:23 2022 +0800

    Fix stream will respond received feedback frame with RST frame when closed
---
 src/brpc/policy/streaming_rpc_protocol.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/brpc/policy/streaming_rpc_protocol.cpp b/src/brpc/policy/streaming_rpc_protocol.cpp
index df47032d..91b71c63 100644
--- a/src/brpc/policy/streaming_rpc_protocol.cpp
+++ b/src/brpc/policy/streaming_rpc_protocol.cpp
@@ -108,7 +108,9 @@ ParseResult ParseStreamingMessage(butil::IOBuf* source,
                             && fm.frame_type() != FRAME_TYPE_CLOSE
                             && fm.frame_type() != FRAME_TYPE_FEEDBACK)
                    << "Fail to find stream=" << fm.stream_id();
-            if (fm.has_source_stream_id()) {
+            // It's normal that the stream is closed before receiving feedback frames from peer.
+            // In this case, RST frame should not be sent to peer, otherwise on-fly data can be lost.
+            if (fm.has_source_stream_id() && fm.frame_type() != FRAME_TYPE_FEEDBACK) {
                 SendStreamRst(socket, fm.source_stream_id());
             }
             break;


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