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

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


The following commit(s) were added to refs/heads/master by this push:
     new 249df0f3 fix window update threshold (#2418)
249df0f3 is described below

commit 249df0f388e4644663d7f05c18044ae7f481e952
Author: jiangyt-git <64257436+jiangyt-...@users.noreply.github.com>
AuthorDate: Thu Dec 14 11:58:43 2023 +0800

    fix window update threshold (#2418)
    
    Co-authored-by: jiangyuting <jiangyutingwan...@163.com>
---
 src/brpc/policy/http2_rpc_protocol.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/brpc/policy/http2_rpc_protocol.cpp 
b/src/brpc/policy/http2_rpc_protocol.cpp
index df88d71f..5b0538d3 100644
--- a/src/brpc/policy/http2_rpc_protocol.cpp
+++ b/src/brpc/policy/http2_rpc_protocol.cpp
@@ -743,7 +743,8 @@ H2ParseResult H2StreamContext::OnData(
     }
 
     const int64_t acc = _deferred_window_update.fetch_add(frag_size, 
butil::memory_order_relaxed) + frag_size;
-    if (acc >= _conn_ctx->local_settings().stream_window_size / 2) {
+    // Allocate the quota of the window to each stream.
+    if (acc >= _conn_ctx->local_settings().stream_window_size / 
(_conn_ctx->VolatilePendingStreamSize() + 1)) {
         if (acc > _conn_ctx->local_settings().stream_window_size) {
             LOG(ERROR) << "Fail to satisfy the stream-level flow control 
policy";
             return MakeH2Error(H2_FLOW_CONTROL_ERROR, frame_head.stream_id);


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

Reply via email to