servicecomb-java-chassis icon indicating copy to clipboard operation
servicecomb-java-chassis copied to clipboard

客户端keepAlive超时建议强制校验限制比客户端idle超时小,以保持兼容

Open smalljunHw opened this issue 3 years ago • 1 comments

查看修改 https://github.com/apache/servicecomb-java-chassis/pull/3927 客户端keep-alive超时会设置比idle超时 -1, 这能确保keep-alive超时比idle超时小

  public static int getConnectionKeepAliveTimeoutInSeconds() {
    if (result >= 0) {
      return result;
    }
    result = getConnectionIdleTimeoutInSeconds();
    if (result > 1) {
      // a bit shorter than ConnectionIdleTimeoutInSeconds
      return result - 1;
    }
    return result;
  }

当前增加了keep-alive超时配置项,Wie

  public static int getConnectionKeepAliveTimeoutInSeconds() {
    int result = DynamicPropertyFactory.getInstance()
    return DynamicPropertyFactory.getInstance()
        .getIntProperty("servicecomb.rest.client.connection.keepAliveTimeoutInSeconds",
            -1)
            DEFAULT_KEEP_ALIVE_TIME_OUT)
        .get();
   }

这样如果业务设置了ideal超时时间<60s,升级版本后将出现keepAlive超时(默认值为60s)大于idle超时的问题。 建议控制让keep-alive超时不要超过 idle超时 - 1的情况,保持之前的约束关系。

smalljunHw avatar Nov 13 '23 12:11 smalljunHw

创建了一个WIKI ,帮助用户升级到 2.8.12及其以上版本, 参考。

liubao68 avatar Nov 13 '23 12:11 liubao68