You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2022/10/19 08:58:04 UTC

[GitHub] [incubator-brpc] chenbay opened a new pull request, #1958: limiting max bytes in stream comsume queue with the same host socket

chenbay opened a new pull request, #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958

   1. Add **socket_max_streams_unconsumed_bytes** to socket for limiting max bytes in stream comsume queue with the same host socket.
   2. Add **min_buffer_size** to stream options and remain_buffer_size to message Feedback for stream buffer control.


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] wwbmmm commented on a diff in pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
wwbmmm commented on code in PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#discussion_r1002857418


##########
src/brpc/stream.cpp:
##########
@@ -284,21 +297,43 @@ int Stream::AppendIfNotFull(const butil::IOBuf &data) {
         _produced -= data.length();
         return -1;
     }
+    if (FLAGS_socket_max_streams_unconsumed_bytes > 0) {
+        _host_socket->_total_streams_unconsumed_size += data.length();
+    }
     return 0;
 }
 
 void Stream::SetRemoteConsumed(size_t new_remote_consumed) {
-    CHECK(_options.max_buf_size > 0);
+    CHECK(_cur_buf_size > 0);
     bthread_id_list_t tmplist;
     bthread_id_list_init(&tmplist, 0, 0);
     bthread_mutex_lock(&_congestion_control_mutex);
     if (_remote_consumed >= new_remote_consumed) {
         bthread_mutex_unlock(&_congestion_control_mutex);
         return;
     }
-    const bool was_full = _produced >= _remote_consumed + (size_t)_options.max_buf_size;
+    const bool was_full = _produced >= _remote_consumed + (size_t)_cur_buf_size;
+
+    if (FLAGS_socket_max_streams_unconsumed_bytes > 0) {
+        _host_socket->_total_streams_unconsumed_size -= new_remote_consumed - _remote_consumed;
+        if (_host_socket->_total_streams_unconsumed_size > FLAGS_socket_max_streams_unconsumed_bytes) {
+            if (_options.min_buf_size > 0) {
+                _cur_buf_size = _options.min_buf_size;
+            } else {
+                _cur_buf_size /= 2;
+            }
+            LOG(INFO) << "stream consumers on socket " << _host_socket->id() << " is crowded, " <<  "cut stream " << id() << " buffer to " << _cur_buf_size;
+        } else if (_produced >= new_remote_consumed + _cur_buf_size && (_options.max_buf_size == 0 || _cur_buf_size < (size_t)_options.max_buf_size)) {

Review Comment:
   如果_options.max_buf_size为负值,转size_t之后可能成为一个很大的正数



##########
src/brpc/stream.cpp:
##########
@@ -72,6 +74,11 @@ int Stream::Create(const StreamOptions &options,
     s->_connected = false;
     s->_options = options;
     s->_closed = false;
+    s->_cur_max_buf_size = options.max_buf_size;
+    if (FLAGS_socket_max_streams_unconsumed_bytes > 0 && options.min_buf_size > 0) {

Review Comment:
   此处应使用s->_options.min_buf_size



-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] wwbmmm commented on a diff in pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
wwbmmm commented on code in PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#discussion_r1000095385


##########
src/brpc/stream_impl.h:
##########
@@ -114,6 +114,7 @@ friend class MessageBatcher;
     bthread_mutex_t _congestion_control_mutex;
     size_t _produced;
     size_t _remote_consumed;
+    size_t _cur_max_buf_size;

Review Comment:
   有了min_buf_size和max_buf_size,这个叫_cur_buf_size是不是更合理。



##########
src/brpc/stream.cpp:
##########
@@ -284,21 +291,43 @@ int Stream::AppendIfNotFull(const butil::IOBuf &data) {
         _produced -= data.length();
         return -1;
     }
+    if (FLAGS_socket_max_streams_unconsumed_bytes > 0) {
+        _host_socket->_total_streams_unconsumed_size += data.length();
+    }
     return 0;
 }
 
 void Stream::SetRemoteConsumed(size_t new_remote_consumed) {
-    CHECK(_options.max_buf_size > 0);
+    CHECK(_cur_max_buf_size > 0);
     bthread_id_list_t tmplist;
     bthread_id_list_init(&tmplist, 0, 0);
     bthread_mutex_lock(&_congestion_control_mutex);
     if (_remote_consumed >= new_remote_consumed) {
         bthread_mutex_unlock(&_congestion_control_mutex);
         return;
     }
-    const bool was_full = _produced >= _remote_consumed + (size_t)_options.max_buf_size;
+    const bool was_full = _produced >= _remote_consumed + (size_t)_cur_max_buf_size;
+
+    if (FLAGS_socket_max_streams_unconsumed_bytes > 0) {
+        _host_socket->_total_streams_unconsumed_size -= new_remote_consumed - _remote_consumed;
+        if (_host_socket->_total_streams_unconsumed_size <= FLAGS_socket_max_streams_unconsumed_bytes) {

Review Comment:
   条件是不是写反了,这里应该是 > ?



##########
src/brpc/stream.cpp:
##########
@@ -72,6 +74,11 @@ int Stream::Create(const StreamOptions &options,
     s->_connected = false;
     s->_options = options;
     s->_closed = false;
+    s->_cur_max_buf_size = options.max_buf_size;
+    if (FLAGS_socket_max_streams_unconsumed_bytes > 0 && options.min_buf_size > 0) {

Review Comment:
   需要判断 min_buf_size < max_buf_size吧,否则是无效配置
   



-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] chenbay commented on pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
chenbay commented on PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#issuecomment-1285234136

   @wwbmmm  ok


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] wwbmmm commented on pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
wwbmmm commented on PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#issuecomment-1286357409

   编译失败且有warning,@chenbay
   
   ```cpp
   src/brpc/stream.cpp:81:30: error: cannot assign to variable 'options' with
         const-qualified type 'const brpc::StreamOptions &'
           options.min_buf_size = 0;
           ~~~~~~~~~~~~~~~~~~~~ ^
   src/brpc/stream.cpp:68:41: note: variable 'options' declared const here
   int Stream::Create(const StreamOptions &options, 
                      ~~~~~~~~~~~~~~~~~~~~~^~~~~~~
   src/brpc/stream.cpp:326:117: warning: comparison of integers of different signs:
         'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
     ...(_options.max_buf_size == 0 || _cur_buf_size < _options.max_buf_size)) {
                                       ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~
   src/brpc/stream.cpp:327:64: warning: comparison of integers of different signs:
         'unsigned long' and 'int' [-Wsign-compare]
     ...> 0 && _cur_buf_size * 2 > _options.max_buf_size) {
               ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~
   ```


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] wwbmmm merged pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
wwbmmm merged PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] wwbmmm commented on pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
wwbmmm commented on PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#issuecomment-1288362761

   > @wwbmmm why is 1 workflow awaiting approval?
   
   Because you are first-time contributor.


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] chenbay commented on pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
chenbay commented on PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#issuecomment-1290061058

   @wwbmmm ok


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] wwbmmm commented on a diff in pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
wwbmmm commented on code in PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#discussion_r1004081732


##########
src/brpc/stream.h:
##########
@@ -49,16 +49,22 @@ class StreamInputHandler {
 
 struct StreamOptions {
     StreamOptions()
-        : max_buf_size(2 * 1024 * 1024)
+        : min_buf_size(1024 * 1024)
+        , max_buf_size(2 * 1024 * 1024)
         , idle_timeout_ms(-1)
         , messages_in_batch(128)
         , handler(NULL)
     {}
 
+    // stream max buffer size limit in [min_buf_size, max_buf_size]
+    // If |min_buf_size| <= 0, there's no min size limit of buf size
+    // default: 1048576 (1M)
+    size_t min_buf_size;
+
     // The max size of unconsumed data allowed at remote side. 
     // If |max_buf_size| <= 0, there's no limit of buf size
     // default: 2097152 (2M)
-    int max_buf_size;
+    size_t max_buf_size;

Review Comment:
   最好不要改已有的字段吧
   而且注释里也写了 <= 0,说明可能是负数
   我意思是用max_buf_size的地方判断一下是否>0再用



-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] chenbay commented on a diff in pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
chenbay commented on code in PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#discussion_r1000380863


##########
src/brpc/stream.cpp:
##########
@@ -72,6 +74,11 @@ int Stream::Create(const StreamOptions &options,
     s->_connected = false;
     s->_options = options;
     s->_closed = false;
+    s->_cur_max_buf_size = options.max_buf_size;
+    if (FLAGS_socket_max_streams_unconsumed_bytes > 0 && options.min_buf_size > 0) {

Review Comment:
   嗯可以改下,这里本来是考虑max_buf_size=0要不限制。



-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] chenbay commented on a diff in pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
chenbay commented on code in PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#discussion_r1000382104


##########
src/brpc/stream_impl.h:
##########
@@ -114,6 +114,7 @@ friend class MessageBatcher;
     bthread_mutex_t _congestion_control_mutex;
     size_t _produced;
     size_t _remote_consumed;
+    size_t _cur_max_buf_size;

Review Comment:
   咋说呢,其实也是max_buf_size,毕竟少用也是可以的,,大概是capacity的意思。



-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] wasphin commented on a diff in pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
wasphin commented on code in PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#discussion_r1004380583


##########
src/brpc/stream.cpp:
##########
@@ -72,6 +74,17 @@ int Stream::Create(const StreamOptions &options,
     s->_connected = false;
     s->_options = options;
     s->_closed = false;
+    s->_cur_buf_size = options.max_buf_size;
+    if (options.max_buf_size > 0 && options.min_buf_size > options.max_buf_size)
+    {

Review Comment:
   这里可以统一下风格, 括号挪上去...



-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] chenbay commented on a diff in pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
chenbay commented on code in PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#discussion_r1004191175


##########
src/brpc/stream.h:
##########
@@ -49,16 +49,22 @@ class StreamInputHandler {
 
 struct StreamOptions {
     StreamOptions()
-        : max_buf_size(2 * 1024 * 1024)
+        : min_buf_size(1024 * 1024)
+        , max_buf_size(2 * 1024 * 1024)
         , idle_timeout_ms(-1)
         , messages_in_batch(128)
         , handler(NULL)
     {}
 
+    // stream max buffer size limit in [min_buf_size, max_buf_size]
+    // If |min_buf_size| <= 0, there's no min size limit of buf size
+    // default: 1048576 (1M)
+    size_t min_buf_size;
+
     // The max size of unconsumed data allowed at remote side. 
     // If |max_buf_size| <= 0, there's no limit of buf size
     // default: 2097152 (2M)
-    int max_buf_size;
+    size_t max_buf_size;

Review Comment:
   > 最好不要改已有的字段吧 而且注释里也写了 <= 0,说明可能是负数 我意思是用max_buf_size的地方判断一下是否>0再用
   
   @wwbmmm 原来==判断改成<=了



-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] chenbay commented on pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
chenbay commented on PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#issuecomment-1283664832

   @wwbmmm  reopen for  https://github.com/apache/incubator-brpc/pull/1928 .


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] chenbay commented on a diff in pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
chenbay commented on code in PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#discussion_r1004184007


##########
src/brpc/stream.h:
##########
@@ -49,16 +49,22 @@ class StreamInputHandler {
 
 struct StreamOptions {
     StreamOptions()
-        : max_buf_size(2 * 1024 * 1024)
+        : min_buf_size(1024 * 1024)
+        , max_buf_size(2 * 1024 * 1024)
         , idle_timeout_ms(-1)
         , messages_in_batch(128)
         , handler(NULL)
     {}
 
+    // stream max buffer size limit in [min_buf_size, max_buf_size]
+    // If |min_buf_size| <= 0, there's no min size limit of buf size
+    // default: 1048576 (1M)
+    size_t min_buf_size;
+
     // The max size of unconsumed data allowed at remote side. 
     // If |max_buf_size| <= 0, there's no limit of buf size
     // default: 2097152 (2M)
-    int max_buf_size;
+    size_t max_buf_size;

Review Comment:
   也行吧,按原来int的逻辑吧。
   
   > 最好不要改已有的字段吧 而且注释里也写了 <= 0,说明可能是负数 我意思是用max_buf_size的地方判断一下是否>0再用
   
   



-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] wwbmmm commented on pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
wwbmmm commented on PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#issuecomment-1290238304

   LGTM


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] chenbay commented on a diff in pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
chenbay commented on code in PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#discussion_r1000376389


##########
src/brpc/stream.cpp:
##########
@@ -284,21 +291,43 @@ int Stream::AppendIfNotFull(const butil::IOBuf &data) {
         _produced -= data.length();
         return -1;
     }
+    if (FLAGS_socket_max_streams_unconsumed_bytes > 0) {
+        _host_socket->_total_streams_unconsumed_size += data.length();
+    }
     return 0;
 }
 
 void Stream::SetRemoteConsumed(size_t new_remote_consumed) {
-    CHECK(_options.max_buf_size > 0);
+    CHECK(_cur_max_buf_size > 0);
     bthread_id_list_t tmplist;
     bthread_id_list_init(&tmplist, 0, 0);
     bthread_mutex_lock(&_congestion_control_mutex);
     if (_remote_consumed >= new_remote_consumed) {
         bthread_mutex_unlock(&_congestion_control_mutex);
         return;
     }
-    const bool was_full = _produced >= _remote_consumed + (size_t)_options.max_buf_size;
+    const bool was_full = _produced >= _remote_consumed + (size_t)_cur_max_buf_size;
+
+    if (FLAGS_socket_max_streams_unconsumed_bytes > 0) {
+        _host_socket->_total_streams_unconsumed_size -= new_remote_consumed - _remote_consumed;
+        if (_host_socket->_total_streams_unconsumed_size <= FLAGS_socket_max_streams_unconsumed_bytes) {

Review Comment:
   是的,= =



-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] chenbay commented on a diff in pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
chenbay commented on code in PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#discussion_r1000382392


##########
src/brpc/stream_impl.h:
##########
@@ -114,6 +114,7 @@ friend class MessageBatcher;
     bthread_mutex_t _congestion_control_mutex;
     size_t _produced;
     size_t _remote_consumed;
+    size_t _cur_max_buf_size;

Review Comment:
   > _cur_buf_size
   
   我先改成_cur_buf_size把



-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] chenbay commented on pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
chenbay commented on PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#issuecomment-1288346058

   @wwbmmm  why is 1 workflow awaiting approval?


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [incubator-brpc] chenbay commented on a diff in pull request #1958: limiting max bytes in stream comsume queue with the same host socket

Posted by GitBox <gi...@apache.org>.
chenbay commented on code in PR #1958:
URL: https://github.com/apache/incubator-brpc/pull/1958#discussion_r1004464608


##########
src/brpc/stream.cpp:
##########
@@ -72,6 +74,17 @@ int Stream::Create(const StreamOptions &options,
     s->_connected = false;
     s->_options = options;
     s->_closed = false;
+    s->_cur_buf_size = options.max_buf_size;
+    if (options.max_buf_size > 0 && options.min_buf_size > options.max_buf_size)
+    {

Review Comment:
   ...其实我的风格是不换行的,,



-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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