Skip to content

Commit

Permalink
fix adapter checktimout check
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanshudong committed Aug 6, 2023
1 parent e2989a6 commit d0afdd1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion servant/libservant/AdapterProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ void AdapterProxy::finishInvoke(bool bFail)
_frequenceFailInvoke++;

//检查是否到了连续失败次数,且至少在5s以上
if (_frequenceFailInvoke >= info.frequenceFailInvoke && now >= _frequenceFailTime)
if (_frequenceFailInvoke >= info.frequenceFailInvoke && (now >= _frequenceFailTime || info.frequenceFailInvoke == 1))
{
setInactive();

Expand Down
2 changes: 1 addition & 1 deletion servant/servant/Message.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace tars
* 如果是灰度状态的服务, 服务失效后如果请求切换, 也只会转发到相同灰度状态的服务
* @uint16_t minTimeoutInvoke, 计算的最小的超时次数, 默认2次(在checkTimeoutInterval时间内超过了minTimeoutInvoke, 才计算超时)
* @uint32_t frequenceFailInvoke, 连续失败次数
* @uint32_t checkTimeoutInterval, 统计时间间隔, (默认60s, 不能小于30s)
* @uint32_t checkTimeoutInterval, 统计时间间隔, (默认60s)
* @float radio, 超时比例 > 该值则认为超时了 ( 0.1<=radio<=1.0 )
* @uint32_t tryTimeInterval, 重试时间间隔
*/
Expand Down

0 comments on commit d0afdd1

Please sign in to comment.