You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by "wwbmmm (via GitHub)" <gi...@apache.org> on 2023/02/09 08:26:44 UTC

[GitHub] [brpc] wwbmmm commented on a diff in pull request #2112: different method can use different TimeoutConcurrencyConf

wwbmmm commented on code in PR #2112:
URL: https://github.com/apache/brpc/pull/2112#discussion_r1101102703


##########
src/brpc/adaptive_max_concurrency.cpp:
##########
@@ -80,6 +86,12 @@ void AdaptiveMaxConcurrency::operator=(int max_concurrency) {
     }
 }
 
+void AdaptiveMaxConcurrency::operator=(const TimeoutConcurrencyConf& value) {
+    _value = "timeout";
+    _max_concurrency = value.max_concurrency;
+    _timeout_ms = value.timeout_ms;
+}
+
 const std::string& AdaptiveMaxConcurrency::type() const {
     if (_max_concurrency > 0) {
         return CONSTANT();

Review Comment:
   timeout concurrency的时候_max_concurrency可能大于0,会导致返回type是CONSTANT(),不符合预期
   还有下面的operator == 操作,如果两个AdaptiveMaxConcurrency类型都是timeout,但参数不一样,会被误判为相等



-- 
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