[BUG] httpClient error: recvAddress(..) failed: Connection reset by peer
- Dominant language
- Java
- Stars
- 8.8k
- Forks
- 3.1k
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 85
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Current Behavior
recvAddress(..) failed: Connection reset by peer
### Expected Behavior
version: 2.6.1
env: docker
bootstrap config as follow,
```java
shenyu:
netty:
http:
# set to false, user can custom the netty tcp server config.
webServerFactoryEnabled: true
selectCount: 2
workerCount: 16
accessLog: false
serverSocketChannel:
soRcvBuf: 2097152
soBackLog: 1024
soReuseAddr: false
connectTimeoutMillis: 10000
writeBufferHighWaterMark: 2097152
writeBufferLowWaterMark: 1048576
writeSpinCount: 16
autoRead: false
allocType: "unpooled"
messageSizeEstimator: 8
singleEventExecutorPerGroup: true
socketChannel:
soKeepAlive: true
soReuseAddr: true
soLinger: -1
tcpNoDelay: true
soRcvBuf: 2097152
soSndBuf: 1048576
ipTos: 0
allowHalfClosure: false
connectTimeoutMillis: 10000
writeBufferHighWaterMark: 2097152
writeBufferLowWaterMark: 1048576
writeSpinCount: 16
autoRead: false
allocType: "unpooled"
messageSizeEstimator: 8
singleEventExecutorPerGroup: true
httpclient:
strategy: webClient # netty
connectTimeout: 45000
responseTimeout: 3000
readerIdleTime: 3000
writerIdleTime: 3000
allIdleTime: 3000
readTimeout: 3000
writeTimeout: 3000
wiretap: false
keepAlive: false
maxInMemorySize: 6 #6mb
pool:
type: ELASTIC
name: shenyuBoot-proxy
maxConnections: 2048
acquireTimeout: 45000
maxIdleTime: 10000 # unit: ms
maxLifeTime: 300000 # unit: ms
evictionInterval: 5000 # unit: ms
metrics: false
```
### Steps To Reproduce
env: k8s
pod spec: 8C16G
### Environment
```markdown
ShenYu version(s):2.6.1
JVM:-XX:+AlwaysPreTouch -XX:-UseBiasedLocking -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./logs/heapdump.hprof -XX:ErrorFile=./logs/hs_err_%p.log -Xms8192m -Xmx8192m -Xmn2048m -Xss512K -XX:+DisableExplicitGC -XX:LargePageSizeInBytes=128m -XX:MaxDirectMemorySize=4096m -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=1024m
```
### Debug logs
2025-06-16 07:14:07 [reactor-http-epoll-7] ERROR org.apache.shenyu.plugin.httpclient.AbstractHttpClientPlugin - recvAddress(..) failed: Connection reset by peer
io.netty.channel.unix.Errors$NativeIoException: recvAddress(..) failed: Connection reset by peer
2025-06-16 07:14:07 [reactor-http-epoll-7] ERROR org.apache.shenyu.web.handler.GlobalErrorHandler - handle error: [d92603a1-592619] Resolved [ResponseStatusException: 408 REQUEST_TIMEOUT "Request timeout, the maximum number of retry times has been exceeded"; nested exception is org.apache.shenyu.plugin.httpclient.exception.ShenyuTimeoutException: Request timeout, the maximum number of retry times has been exceeded]
### Anything else?
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the error from org.apache.shenyu.plugin.httpclient.AbstractHttpClientPlugin through GlobalErrorHandler, using the supplied httpclient configuration and debug logs to reproduce the connection reset and timeout path. Done means the cause of the recvAddress failure is identified and the resulting timeout behavior is verified in the Kubernetes or Docker environment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100