You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by "yhs0092 (via GitHub)" <gi...@apache.org> on 2023/08/21 01:58:31 UTC
[GitHub] [servicecomb-java-chassis] yhs0092 opened a new issue, #3905: Java-Chassis 2.8.9 的 HTTP/2 Keep-alive 超时时间默认配置不合适
yhs0092 opened a new issue, #3905:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3905
## 问题版本
Java-Chassis 2.8.9
## 问题原因
HTTP/2连接的Keep-alive超时时间配置项默认值为`-1`, idle超时时间默认值取的`io.vertx.core.net.TCPSSLOptions#DEFAULT_IDLE_TIMEOUT`常量值为`0`.
如果业务没有配置超时时间, 则按照`org.apache.servicecomb.transport.rest.client.TransportClientConfig#getHttp2ConnectionKeepAliveTimeoutInSeconds`方法的逻辑, 实际取到的生效值为`0`.
```java
public static int getHttp2ConnectionKeepAliveTimeoutInSeconds() {
int result = DynamicPropertyFactory.getInstance()
.getIntProperty("servicecomb.rest.client.http2.connection.keepAliveTimeoutInSeconds", -1)
.get(); // <-- 取默认配置值 -1
if (result >= 0) { // <-- 跳过if
return result;
}
result = getHttp2ConnectionIdleTimeoutInSeconds(); // <-- 取默认HTTP/2 idle超时 0 秒
if (result > 1) { // <-- 跳过 if
// a bit shorter than ConnectionIdleTimeoutInSeconds
return result - 1;
}
return result; // <-- 最终返回0
}
```
而按照Vert.x的API注释, Keep-alive超时和idle超时时间配置为`0`时, 均视为不超时.
与此同时, server端idle超时配置项的默认值是`60`秒.
于是, 如果业务全部取默认的超时配置, 就是客户端的连接idle超时和Keep-alive超时机制不生效, 而服务端为60秒idle超时. 流量较小时就会碰到客户端间隔60秒复用HTTP/2长连接发送请求, 刚好碰到服务端idle超时断连接, 请求发送失败的情况.
--
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: commits-unsubscribe@servicecomb.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #3905: Java-Chassis 2.8.9 的 HTTP/2 Keep-alive 超时时间默认配置不合适
Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 commented on issue #3905:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3905#issuecomment-1685568842
java chassis使用了第三方组件的场景,后续总体的策略是默认值跟随第三方(早期的一些定制的配置项,则不变化)。 这个问题提供了一个很好的案例,建议结合业务实际情况下,显示的设置下配置项的缺省值。 java chassis会跟随上述策略,维持缺省值不变化。
--
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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] liubao68 closed issue #3905: Java-Chassis 2.8.9 的 HTTP/2 Keep-alive 超时时间默认配置不合适
Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 closed issue #3905: Java-Chassis 2.8.9 的 HTTP/2 Keep-alive 超时时间默认配置不合适
URL: https://github.com/apache/servicecomb-java-chassis/issues/3905
--
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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #3905: Java-Chassis 2.8.9 的 HTTP/2 Keep-alive 超时时间默认配置不合适
Posted by "liubao68 (via GitHub)" <gi...@apache.org>.
liubao68 commented on issue #3905:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3905#issuecomment-1709414833
Changed in 2.8.10
--
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: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org