Report can_connect when the ibm_was request times out or the XML is malformed #25712
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.42) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 345 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
Diff Size
diff_size
0.350
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #25712"
general
weight: 0.35
iliakur
What does this PR do?
make_request()handler from(requests.HTTPError, requests.ConnectionError)torequests.RequestException, so timeouts and other request failures reportcan_connectCRITICAL.lxml.etree.XMLSyntaxErrorinstead ofxml.etree.ElementTree.ParseErrorwhen parsing the response.self.log.Error(...)->self.log.error(...)in that handler, which would have raisedAttributeError.Motivation
requests.ReadTimeoutdescends fromTimeout->RequestException, never fromConnectionError. It escapedmake_request()uncaught, sosubmit_service_checks()was never reached and the run submitted no service check and nocan_connectgauge.ConnectTimeoutwas caught, because it inherits from bothConnectionErrorandTimeout. So the same user-visible failure reported two different ways depending on where it timed out.etree.fromstringraisesXMLSyntaxError, which is a sibling ofParseErrorunderSyntaxError, not a subclass. The existing clause never matched, so malformed responses escaped unhandled with the same silent outcome.malloc_trimhelper todatadog_checks_base, the first step in fixing the unbounded RSS growth found in the same investigation. Independent of this PR; either can merge first.Checklist before requesting review
<!--
test_request_failure_reports_criticalis parameterized over ReadTimeout, ConnectTimeout andTooManyRedirects;
test_malformed_xml_reports_criticalcovers the parse path and asserts thelog line. Verified against the unfixed source: 'read timeout', 'too many redirects' and the
malformed-XML case all fail ("Needed exactly 1 candidates for 'ibm_was.can_connect', got 0",
and a raw XMLSyntaxError escaping). 'connect timeout' passes before and after, documenting
the inheritance quirk and guarding it. Full suite: 13 passed, 1 skipped.
-->
🤖 Generated with Claude Code