XLPE opened a new pull request, #51944:
URL: https://github.com/apache/doris/pull/51944
### What problem does this PR solve?
Issue Number: close #51941
Related PR: #xxx
Problem Summary:
Every time an FE node restarts, the following exception keeps appearing.
```
2025-06-19 10:59:51,722 WARN (Manual Analysis Job Executor-1|12257)
[StatisticsCache.sendStats():241] Failed to sync stats to follower:
TNetworkAddress(hostname:192.168.71.14, port:9520)
org.apache.thrift.transport.TTransportException: java.net.SocketException:
Broken pipe
at
org.apache.thrift.transport.TIOStreamTransport.flush(TIOStreamTransport.java:216)
~[libthrift-0.16.0.jar:0.16.0]
at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:73)
~[libthrift-0.16.0.jar:0.16.0]
at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62)
~[libthrift-0.16.0.jar:0.16.0]
at
org.apache.doris.thrift.FrontendService$Client.sendUpdateStatsCache(FrontendService.java:1370)
~[fe-common-1.2-SNAPSHOT.jar:1.2-SNAPSHOT]
at
org.apache.doris.thrift.FrontendService$Client.updateStatsCache(FrontendService.java:1362)
~[fe-common-1.2-SNAPSHOT.jar:1.2-SNAPSHOT]
at
org.apache.doris.statistics.StatisticsCache.sendStats(StatisticsCache.java:239)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.statistics.StatisticsCache.syncColStats(StatisticsCache.java:229)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.statistics.BaseAnalysisTask.runQuery(BaseAnalysisTask.java:309)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.statistics.OlapAnalysisTask.doSample(OlapAnalysisTask.java:136)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.statistics.OlapAnalysisTask.doExecute(OlapAnalysisTask.java:96)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.statistics.BaseAnalysisTask.execute(BaseAnalysisTask.java:175)
~[doris-fe.jar:1.2-SNAPSHOT]
at
org.apache.doris.statistics.AnalysisTaskWrapper.lambda$new$0(AnalysisTaskWrapper.java:43)
~[doris-fe.jar:1.2-SNAPSHOT]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at
org.apache.doris.statistics.AnalysisTaskWrapper.run(AnalysisTaskWrapper.java:66)
~[doris-fe.jar:1.2-SNAPSHOT]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
~[?:?]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.net.SocketException: Broken pipe
at sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:420) ~[?:?]
at sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440) ~[?:?]
at sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:826) ~[?:?]
at java.net.Socket$SocketOutputStream.write(Socket.java:1035) ~[?:?]
at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81) ~[?:?]
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
~[?:?]
at
org.apache.thrift.transport.TIOStreamTransport.flush(TIOStreamTransport.java:211)
~[libthrift-0.16.0.jar:0.16.0]
... 18 more
```
The root cause is that the client fails to catch IO exceptions, leading to
closed connections being returned to the pool. Additionally, the isOpen()
validation method in the code relies on isConnected(), which cannot detect
closed or broken connections.
This pull request examines and resolves all related issues.
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [X] Regression test
- [X] Unit Test
- [X] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]