Repository navigation
fix(search): pin httpclient5 to 5.5.2 and bound the connection-request timeout - #31657
Conversation
…t timeout Two related fixes for a total, unrecoverable loss of search. 1. Version skew. Pinning httpcore5 to 5.4.3 for CVE-2026-54399 left httpclient5 unmanaged, so it resolved to 5.5 — a release built against httpcore5 5.3.4. Apache fixed HttpClient's incompatibility with the HttpCore 5.4 branch in httpclient5 5.5.2. On the mismatched pair, SingleCoreIOReactor dispatchers die on the I/O thread. IOReactorWorker stores the Throwable in a field nothing reads and the thread exits, and MultiCoreIOReactor's status is only ever written by start/initiateShutdown/close, so the client stays ACTIVE and keeps accepting work. Connections bound to a dead dispatcher are leased forever and no timeout fires, because timeout enforcement lives inside the dispatcher's own select loop. Once every maxConnPerRoute slot is a zombie, all search calls queue until the connection-request deadline and fail with DeadlineTimeoutException. Nothing recovers it but a restart. SafeResponseConsumer (#27698) guards only the response-consumer path, so it does not cover this. 2. Unbounded lease wait. Both clients set connect and response timeouts but never setConnectionRequestTimeout, leaving HC5's 3-minute default. A saturated pool therefore blocks a Jetty thread for three minutes per request before failing. Bound it to 10s so callers fail fast. Observed in production: 100% of search-backed endpoints failing for 20+ minutes, p50 195-257s, while every non-search endpoint stayed at ~3ms. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ ApprovedPins httpclient5 to 5.5.2 to resolve version skew with httpcore5 and bounds the connection-request timeout to 10 seconds. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
✅ Playwright Results — workflow succeededValidated commit ✅ 1027 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 1h 12m 2s ⏱️ Max setup 3m 5s · max shard execution 17m 9s · max shard-job elapsed before upload 25m 3s · reporting 5s 🌐 195.54 requests/attempt · 2.21 app boots/UI scenario · 12.05% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
Changes have been cherry-picked to the 2.0 branch. |
…t timeout (#31657) Two related fixes for a total, unrecoverable loss of search. 1. Version skew. Pinning httpcore5 to 5.4.3 for CVE-2026-54399 left httpclient5 unmanaged, so it resolved to 5.5 — a release built against httpcore5 5.3.4. Apache fixed HttpClient's incompatibility with the HttpCore 5.4 branch in httpclient5 5.5.2. On the mismatched pair, SingleCoreIOReactor dispatchers die on the I/O thread. IOReactorWorker stores the Throwable in a field nothing reads and the thread exits, and MultiCoreIOReactor's status is only ever written by start/initiateShutdown/close, so the client stays ACTIVE and keeps accepting work. Connections bound to a dead dispatcher are leased forever and no timeout fires, because timeout enforcement lives inside the dispatcher's own select loop. Once every maxConnPerRoute slot is a zombie, all search calls queue until the connection-request deadline and fail with DeadlineTimeoutException. Nothing recovers it but a restart. SafeResponseConsumer (#27698) guards only the response-consumer path, so it does not cover this. 2. Unbounded lease wait. Both clients set connect and response timeouts but never setConnectionRequestTimeout, leaving HC5's 3-minute default. A saturated pool therefore blocks a Jetty thread for three minutes per request before failing. Bound it to 10s so callers fail fast. Observed in production: 100% of search-backed endpoints failing for 20+ minutes, p50 195-257s, while every non-search endpoint stayed at ~3ms. Co-authored-by: Claude Opus 5 (1M context) <[email protected]> (cherry picked from commit 444b955)
|
Changes have been cherry-picked to the 1.13 branch. |
…t timeout (#31657) Two related fixes for a total, unrecoverable loss of search. 1. Version skew. Pinning httpcore5 to 5.4.3 for CVE-2026-54399 left httpclient5 unmanaged, so it resolved to 5.5 — a release built against httpcore5 5.3.4. Apache fixed HttpClient's incompatibility with the HttpCore 5.4 branch in httpclient5 5.5.2. On the mismatched pair, SingleCoreIOReactor dispatchers die on the I/O thread. IOReactorWorker stores the Throwable in a field nothing reads and the thread exits, and MultiCoreIOReactor's status is only ever written by start/initiateShutdown/close, so the client stays ACTIVE and keeps accepting work. Connections bound to a dead dispatcher are leased forever and no timeout fires, because timeout enforcement lives inside the dispatcher's own select loop. Once every maxConnPerRoute slot is a zombie, all search calls queue until the connection-request deadline and fail with DeadlineTimeoutException. Nothing recovers it but a restart. SafeResponseConsumer (#27698) guards only the response-consumer path, so it does not cover this. 2. Unbounded lease wait. Both clients set connect and response timeouts but never setConnectionRequestTimeout, leaving HC5's 3-minute default. A saturated pool therefore blocks a Jetty thread for three minutes per request before failing. Bound it to 10s so callers fail fast. Observed in production: 100% of search-backed endpoints failing for 20+ minutes, p50 195-257s, while every non-search endpoint stayed at ~3ms. Co-authored-by: Claude Opus 5 (1M context) <[email protected]> (cherry picked from commit 444b955)
…ntent compression (#31667) * fix(search): move httpclient5 to 5.6.3 and disable transport-level content compression Follow-up to #31657, which pinned httpclient5 to 5.5.2 so it stopped being mismatched against the httpcore5 5.4 line. 5.5.2 was the minimal fix but it still sits inside the CVE-2026-64607 range (affects 5.0-alpha1 through 5.6.2: the classic i/o client leaks a connection when a response carries an invalid Content-Encoding, exhausting the pool). 5.6.3 clears that CVE and is a better pairing besides: httpclient5-parent 5.6.3 declares httpcore5 5.4.3, exactly the version pinned here, whereas 5.5.2 targets 5.3.6. Client and core now come from the same line Apache releases together. Moving to the 5.6 line requires one code change. httpclient5 5.6.0 turned on automatic content decompression in the async client pipeline by default, and both search transports already decompress the response body themselves. Leaving both enabled runs the second pass over already-inflated bytes and throws "java.util.zip.ZipException: Not in GZIP format". Disable it at the transport layer in OpenSearchClient and ElasticSearchClient and let the search clients own decompression. The connection-request timeout bound from #31657 is unchanged. Note for future bumps: the shaded uber-jars in openmetadata-shaded-deps bundle org.apache.hc.* unrelocated, so they carry their own copy of httpclient5 and httpcore5 and precede the standalone jars on the classpath. They inherit this dependencyManagement block, so a clean build keeps both copies aligned - but the pin only takes effect once those modules are rebuilt. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * test(search): disable transport-level content compression in integration test clients The integration tests build their own OpenSearch/Elasticsearch clients, so they need the same disableContentCompression() call as the production search clients once httpclient5 moves to the 5.6 line. Without it they fail with "java.util.zip.ZipException: Not in GZIP format". Taken from #31525 by yan-3005. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…ntent compression (#31667) * fix(search): move httpclient5 to 5.6.3 and disable transport-level content compression Follow-up to #31657, which pinned httpclient5 to 5.5.2 so it stopped being mismatched against the httpcore5 5.4 line. 5.5.2 was the minimal fix but it still sits inside the CVE-2026-64607 range (affects 5.0-alpha1 through 5.6.2: the classic i/o client leaks a connection when a response carries an invalid Content-Encoding, exhausting the pool). 5.6.3 clears that CVE and is a better pairing besides: httpclient5-parent 5.6.3 declares httpcore5 5.4.3, exactly the version pinned here, whereas 5.5.2 targets 5.3.6. Client and core now come from the same line Apache releases together. Moving to the 5.6 line requires one code change. httpclient5 5.6.0 turned on automatic content decompression in the async client pipeline by default, and both search transports already decompress the response body themselves. Leaving both enabled runs the second pass over already-inflated bytes and throws "java.util.zip.ZipException: Not in GZIP format". Disable it at the transport layer in OpenSearchClient and ElasticSearchClient and let the search clients own decompression. The connection-request timeout bound from #31657 is unchanged. Note for future bumps: the shaded uber-jars in openmetadata-shaded-deps bundle org.apache.hc.* unrelocated, so they carry their own copy of httpclient5 and httpcore5 and precede the standalone jars on the classpath. They inherit this dependencyManagement block, so a clean build keeps both copies aligned - but the pin only takes effect once those modules are rebuilt. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * test(search): disable transport-level content compression in integration test clients The integration tests build their own OpenSearch/Elasticsearch clients, so they need the same disableContentCompression() call as the production search clients once httpclient5 moves to the 5.6 line. Without it they fail with "java.util.zip.ZipException: Not in GZIP format". Taken from #31525 by yan-3005. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…ntent compression (#31667) * fix(search): move httpclient5 to 5.6.3 and disable transport-level content compression Follow-up to #31657, which pinned httpclient5 to 5.5.2 so it stopped being mismatched against the httpcore5 5.4 line. 5.5.2 was the minimal fix but it still sits inside the CVE-2026-64607 range (affects 5.0-alpha1 through 5.6.2: the classic i/o client leaks a connection when a response carries an invalid Content-Encoding, exhausting the pool). 5.6.3 clears that CVE and is a better pairing besides: httpclient5-parent 5.6.3 declares httpcore5 5.4.3, exactly the version pinned here, whereas 5.5.2 targets 5.3.6. Client and core now come from the same line Apache releases together. Moving to the 5.6 line requires one code change. httpclient5 5.6.0 turned on automatic content decompression in the async client pipeline by default, and both search transports already decompress the response body themselves. Leaving both enabled runs the second pass over already-inflated bytes and throws "java.util.zip.ZipException: Not in GZIP format". Disable it at the transport layer in OpenSearchClient and ElasticSearchClient and let the search clients own decompression. The connection-request timeout bound from #31657 is unchanged. Note for future bumps: the shaded uber-jars in openmetadata-shaded-deps bundle org.apache.hc.* unrelocated, so they carry their own copy of httpclient5 and httpcore5 and precede the standalone jars on the classpath. They inherit this dependencyManagement block, so a clean build keeps both copies aligned - but the pin only takes effect once those modules are rebuilt. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * test(search): disable transport-level content compression in integration test clients The integration tests build their own OpenSearch/Elasticsearch clients, so they need the same disableContentCompression() call as the production search clients once httpclient5 moves to the 5.6 line. Without it they fail with "java.util.zip.ZipException: Not in GZIP format". Taken from #31525 by yan-3005. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Problem
Search dies completely and never recovers. Every OpenSearch-backed endpoint fails while everything else stays healthy.
Observed in production over a 20+ minute window:
loggedInUser38ms,docStore5ms,tasks/visible21ms)search/query→ 500slowrequestconfirms where it goes:search: 257467ms, searchOps: 1. DB, Jetty and gRPC were all fine.The only error in the logs, thousands of times, is:
Zero successes. Zero response timeouts. Zero connect errors. Only the evictor sweeping rotted pool leases.
Root cause
Version skew introduced by #31442. Pinning
httpcore5to 5.4.3 for CVE-2026-54399 lefthttpclient5unmanaged, so it resolved to 5.5 — a release built against httpcore5 5.3.4:Verified in the current tree:
SingleCoreIOReactorwas substantially rewritten between 5.3.4 and 5.4.3 (406 added / 291 removed / 72 modified lines), whileMultiCoreIOReactor,IOWorkersandIOReactorWorkerare byte-identical — the client's assumptions about reactor lifecycle did not move with the reactor underneath.Why that produces exactly the symptoms above, all verified in HC5 source:
Throwableon an I/O dispatcher kills itsSingleCoreIOReactor.IOReactorWorker.run()stores it in a package-private field nothing reads and the thread exits — silently, no log, no callback.MultiCoreIOReactor.statusis only ever written bystart()/initiateShutdown()/close(). A dead dispatcher never flips it, so the client staysACTIVEand keeps accepting requests. A status check cannot detect this.SingleCoreIOReactor.execute()'s select loop (checkTimeout). A dead loop enforces nothing — hence 20+ minutes with no response timeout despitesocketTimeoutSecs: 120.IOWorkersselection is blind round-robin with no health awareness, so pool slots keep migrating onto dead dispatchers.maxConnPerRoute, no new connect is attempted, soIOReactorShutdownExceptionnever surfaces. Leases just queue.DeadlineTimeoutException. Permanent; no recovery path exists short of a restart.SafeResponseConsumer(#27698) guards only the response-consumer path, so it does not cover this.Changes
1. Pin
httpclient5to 5.5.2 so it moves together with thehttpcore5pin.5.5.2 over 5.6 deliberately: 5.6 is the release paired with the 5.4 core line, but it changes default hostname verification to
BUILTINand enables 5s TCP keep-alive by default. Both need TLS validation againstcreateElasticSearchSSLContext/truststorePathsetups. 5.5.2 is a patch on the 5.5 line that carries exactly the compatibility fix, with no breaking changes. 5.6 is worth doing separately.2. Bound
connectionRequestTimeoutto 10s in bothOpenSearchClientandElasticSearchClient.Both set connect and response timeouts but never set the connection-request (pool lease) timeout, leaving HC5's 3-minute default. A saturated pool therefore blocks a Jetty thread for three minutes per request before failing. This is independent of the version bug and worth having regardless — it turns a multi-minute hang into a fast error.
Verification
Resolution after the pin, including the shaded uber-jar (which bundles
org.apache.hc.*unrelocated, so it needed checking):mvn -pl openmetadata-service compile→ BUILD SUCCESS.mvn spotless:applyclean.CVE-2026-54399 stays closed —
httpcore5remains at 5.4.3.Follow-ups (not in this PR)
SearchIndexMetrics.countMissingIndicesprobes every index individually — 71 mappings × 2 calls.refreshStats()already fetcheslistIndicesByPrefix(""); diffing that againstgetEntityIndexMap()keys would make it 1 call.DatabseAndSearchServiceStatusJobhas no@DisallowConcurrentExecution. During this outage 9 concurrent instances were observed across Quartz workers 1-5 and 7-10, consuming the entire 10-threadDefaultQuartzSchedulerpool, so no scheduled job could run at all.🤖 Generated with Claude Code
Greptile Summary
This PR pins Apache HttpClient 5.5.2 to remain compatible with the existing HttpCore 5.4.3 pin and adds a 10-second connection-pool lease timeout to both search clients.
Confidence Score: 5/5
The PR appears safe to merge, with no concrete blocking or independently actionable non-blocking issues identified.
The dependency pin consistently applies the intended HC5 compatibility pairing, and both search-client builders now bound connection-pool acquisition without evidence of a broken build, ineffective configuration, or reachable regression.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(search): pin httpclient5 to 5.5.2 an..." | Re-trigger Greptile
Context used: