JianhuaGong opened a new issue, #4516:
URL: https://github.com/apache/servicecomb-java-chassis/issues/4516
在servicecomb.invocation.timeout未配置时,而全链路超时时间默认取值为2倍的request.timeout,当request.timeout配置较小时(很多业务配置较小),只要客户端client
filter执行时间稍微长一点,就会造成请求报408,不符合使用预期,也与历史行为不一致。
```
private void guardedWait(Invocation invocation) throws InvocationException
{
long wait = getWaitTime(invocation);
try {
if (wait <= 0) {
latch.await();
return;
}
if (latch.await(wait, TimeUnit.MILLISECONDS)) {
return;
}
} catch (InterruptedException e) {
//ignore
}
throw new InvocationException(REQUEST_TIMEOUT,
ExceptionCodes.INVOCATION_TIMEOUT, "Invocation Timeout.");
}
private long getWaitTime(Invocation invocation) {
if (invocation.getOperationMeta().getConfig().getMsInvocationTimeout() >
0) {
return
invocation.getOperationMeta().getConfig().getMsInvocationTimeout();
}
return invocation.getOperationMeta().getConfig().getMsRequestTimeout() *
2;
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]