superhail commented on code in PR #2820: URL: https://github.com/apache/brpc/pull/2820#discussion_r1851563364
########## src/brpc/server.cpp: ########## @@ -2302,6 +2310,74 @@ int Server::MaxConcurrencyOf(google::protobuf::Service* service, return MaxConcurrencyOf(service->GetDescriptor()->full_name(), method_name); } +bool& Server::IgnoreEovercrowdedOf(MethodProperty* mp) { + if (IsRunning()) { + LOG(WARNING) << "IgnoreEovercrowdedOf is only allowd before Server started"; + return g_default_ignore_eovercrowded; + } + if (mp->status == NULL) { + LOG(ERROR) << "method=" << mp->method->full_name() + << " does not support ignore_eovercrowded"; + _failed_to_set_ignore_eovercrowded = true; + return g_default_ignore_eovercrowded; + } + return mp->ignore_eovercrowded; +} + +bool Server::IgnoreEovercrowdedOf(const MethodProperty* mp) const { + if (IsRunning()) { + LOG(WARNING) << "IgnoreEovercrowdedOf is only allowd before Server started"; + return g_default_ignore_eovercrowded; + } + if (mp == NULL || mp->status == NULL) { + return false; Review Comment: 应该要设置一下,我看MaxConcurrencyOf也没有加,这个是漏掉了吗? ``` int Server::MaxConcurrencyOf(const MethodProperty* mp) const { if (IsRunning()) { LOG(WARNING) << "MaxConcurrencyOf is only allowed before Server started"; return g_default_max_concurrency_of_method; } if (mp == NULL || mp->status == NULL) { return 0; } return mp->max_concurrency; } ``` ########## src/brpc/server.h: ########## @@ -417,6 +417,12 @@ class Server { const google::protobuf::MethodDescriptor* method; MethodStatus* status; AdaptiveMaxConcurrency max_concurrency; + // ignore_eovercrowded on method-level, it should be used with carefulness. + // It might introduce inbalance between methods, + // as some methods(ignore_eovercrowded=1) might never return eovercrowded + // while other methods(ignore_eovercrowded=0) keep returning eovercrowded. + // currently only valid for baidu_rpc, http_rpc, hulu_pbrpc and sofa_pbrpc protocols + bool ignore_eovercrowded = false; Review Comment: 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-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org