lihongjie0209 opened a new issue, #70317: URL: https://github.com/apache/doris/issues/70317
### What happened? Repeated `SHOW QUERY STATS` requests on a Frontend (FE) cause its TCP connections to peer FEs to grow with the number of requests. The peer FE eventually accumulates many Thrift server workers blocked on socket reads and can reach its worker limit. ### Root cause `QueryStatsUtil.getStats()` borrows a `FrontendService.Client` from `ClientPool.frontendPool` for every live peer FE, calls `getQueryStats()`, and never returns or invalidates the borrowed client. This is true for a successful response, a skipped response, and an RPC exception. The borrowed connection therefore remains active and unavailable for reuse. Current `master` at `87b462e4f58104140f098f5f4a8b5d58bec70149` still has this code in `fe/fe-core/src/main/java/org/apache/doris/statistics/query/QueryStatsUtil.java`. ### How to reproduce 1. Start a cluster with at least two FEs. 2. Repeatedly issue `SHOW QUERY STATS` through one FE. 3. On a peer FE, count established connections from the requesting FE to its FE RPC port (default 9020): `ss -Htn state established '( sport = :9020 )'`. 4. Observe that the connection count increases with requests and does not return to the pool's idle baseline. ### Expected behavior Return the client to the pool after a completed RPC, including responses that are skipped during validation. Invalidate the client if the RPC fails. ### Versions Observed in 2.1.8 family; also present in current `master` as noted above. -- 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]
