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

[GitHub] [brpc] yanglimingcn opened a new pull request, #2112: different method can use different TimeoutConcurrencyConf

yanglimingcn opened a new pull request, #2112:
URL: https://github.com/apache/brpc/pull/2112

   ### What problem does this PR solve?
   
   Issue Number:
   
   Problem Summary:
   
   ### What is changed and the side effects?
   
   Changed:
   
   Side effects:
   - Performance effects(性能影响):
   
   - Breaking backward compatibility(向后兼容性): 
   
   ---
   ### Check List:
   - Please make sure your changes are compilable(请确保你的更改可以通过编译).
   - When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
   - Please follow [Contributor Covenant Code of Conduct](../../master/CODE_OF_CONDUCT.md).(请遵循贡献者准则).
   


-- 
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] [brpc] yanglimingcn commented on a diff in pull request #2112: different method can use different TimeoutConcurrencyConf

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on code in PR #2112:
URL: https://github.com/apache/brpc/pull/2112#discussion_r1104090275


##########
src/brpc/adaptive_max_concurrency.h:
##########
@@ -59,9 +68,11 @@ class AdaptiveMaxConcurrency{
     static const std::string& UNLIMITED();
     static const std::string& CONSTANT();
 
-private:
+   private:

Review Comment:
   done,我这边对以后文件,如果使用clang-format等工具,会变化比较多,所以现在都是手动修改的,你这边有啥建议吗?



-- 
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] [brpc] wwbmmm commented on a diff in pull request #2112: different method can use different TimeoutConcurrencyConf

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
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


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

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm commented on PR #2112:
URL: https://github.com/apache/brpc/pull/2112#issuecomment-1427598640

   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


Re: [PR] different method can use different TimeoutConcurrencyConf (brpc)

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm merged PR #2112:
URL: https://github.com/apache/brpc/pull/2112


-- 
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] [brpc] yanglimingcn commented on pull request #2112: different method can use different TimeoutConcurrencyConf

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on PR #2112:
URL: https://github.com/apache/brpc/pull/2112#issuecomment-1426955912

   > 
   
   done


-- 
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] [brpc] wwbmmm commented on pull request #2112: different method can use different TimeoutConcurrencyConf

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm commented on PR #2112:
URL: https://github.com/apache/brpc/pull/2112#issuecomment-1423808440

   建议补充对应单测


-- 
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] [brpc] wwbmmm commented on a diff in pull request #2112: different method can use different TimeoutConcurrencyConf

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm commented on code in PR #2112:
URL: https://github.com/apache/brpc/pull/2112#discussion_r1104183958


##########
src/brpc/adaptive_max_concurrency.h:
##########
@@ -59,9 +68,11 @@ class AdaptiveMaxConcurrency{
     static const std::string& UNLIMITED();
     static const std::string& CONSTANT();
 
-private:
+   private:

Review Comment:
   可以考虑按照brpc的编码风格定制一个单独的clang-format配置



-- 
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] [brpc] wwbmmm commented on a diff in pull request #2112: different method can use different TimeoutConcurrencyConf

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm commented on code in PR #2112:
URL: https://github.com/apache/brpc/pull/2112#discussion_r1103938108


##########
src/brpc/adaptive_max_concurrency.h:
##########
@@ -59,9 +68,11 @@ class AdaptiveMaxConcurrency{
     static const std::string& UNLIMITED();
     static const std::string& CONSTANT();
 
-private:
+   private:

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