[id:48b8a8f5-1, L:/网关:37187 - R:应用/应用:应用端口] The connection observed an error, the request cannot be retried as the headers/body were sent
ioty.channel.unix.Errors$NativeIoException: readAddress(..) failed: Connection reset by peer
[2021-12-28T11:31:06,329] DEBUG Stopping retries since predicate returned false, retry context: iteration=1 exception=ioty.channel.unix.Errors$NativeIoException: readAddress(..) failed: Connection reset by peer backoff={0ms}
[2021-12-28T11:31:06,330] ERROR ==>返回错误信息
ioty.channel.unix.Errors$NativeIoException: readAddress(..) failed: Connection reset by peerSuppressed: publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):|_ checkpoint ⇢ org.s.reactive.CorsWebFilter [DefaultWebFilterChain]...|_ checkpoint ⇢ HTTP POST "接口" [ExceptionHandlingWebHandler]
Stack trace:
大体一看,是netty报的io异常,然后被reactor-netty抛出到网关返回了。
reactor-netty是SCG的底层依赖,去
发现有同样的issue。
大体总结就是
spring:cloud:gateway:httpclient:response-timeout: 10spool:type: fixedmax-idle-time: 5000max-connections: 200acquire-timeout: 45000
-Dreactorty.pool.leasingStrategy=lifo
server:tomcat:connection-timeout: 10000 #根据需要
spring: cloud:nacos:discovery:metadata:response-timeout: 10000connect-timeout: 3000
upstream gateway {
# ip_hash;:xx weight=1;:xx weight=1;keepalive 100;keepalive_requests 30000;keepalive_timeout 300s;
}
location /xxx{
proxy_pass gateway;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
使用arthas
.html
curl -O .jar
java -jar arthas-boot.jar
附加到网关
vmtool --action getInstances --classLoaderClass org.springframework.boot.loader.LaunchedURLClassLoader --className sources.PooledConnectionProvider --express 'instances[0].defaultPoolFactory.leasingStrategy'
返回
@String[lifo]
则说明修改成功
本文发布于:2024-02-01 15:19:46,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170677198837545.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |