[fix](fe) Return query stats clients to FE pool #70318
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.40) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 292 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.340
Real PR Conversation Timeline
1 comments
"Review active on #70318"
general
weight: 0.35
morrySnow
Background
SHOW QUERY STATSmerges local query hit counts with counts from other live Frontends.QueryStatsUtil.getStats()calls each peer through a pooled FE Thrift client.What problem does this PR solve?
Issue Number: close #70317
Related PR: None
PR Type: Bugfix
Problem Summary: Every remote query stats call borrows a client without returning it, so repeated requests accumulate FE-to-FE connections and can exhaust peer Thrift workers. Return clients after completed RPCs, including skipped responses, and invalidate clients when the RPC fails. Existing query stats results are unchanged.
Details
QueryStatsUtil.getStats()borrows fromClientPool.frontendPoolbut has no matchingreturnObjectorinvalidateObjectcall.finallyblock to return a client after a completed RPC or invalidate it after an RPC exception.getStats(), including status checks and empty results. The same leak is present in the 2.1.8 family; a backport may be appropriate.Testing
git diff --checkpassed locally.09e50c91. The incremental coverage check then reported 7/8 changed lines;abb6dd20adds the missing borrow-failure case. CI for the new commit is pending. Local FE tests were not run because this sparse checkout lacks the requiredthirdparty/installed/bin/protoc.Release note
Repeated
SHOW QUERY STATSrequests no longer accumulate FE-to-FE Thrift connections.Check List (For Author)
AI Disclosure