[FTR] Configure undici timeouts on KbnClient dispatcher#270932
Merged
Conversation
Since elastic#268531 migrated KbnClient from axios to native fetch, the undici Agent is constructed without timeout overrides, so all FTR Kibana traffic inherits undici's default 10s connect timeout and 5 min headers/body timeouts. Axios had no equivalent connect timeout, which masked any Kibana stall before the new client landed. The weekly kibana-streams-performance pipeline started failing in builds elastic#9, elastic#11, elastic#12 and elastic#13 (2026-05-18 onward) with "ConnectTimeoutError ... timeout: 10000ms" while POSTing a large multipart content/import payload to Kibana under heavy load. Set generous undici timeouts on the dispatcher for both http and https targets: - connect timeout: 60s (vs 10s default) - headers timeout: 5 min (matches undici default, made explicit) - body timeout: 10 min These match the effectively-unlimited behaviour FTR relied on under axios while keeping a finite safeguard. Always constructing a dispatcher also lets us drop the optional spread in the fetch call.
Self-review caught two no-op/speculative changes that should not ship: - headersTimeout: 5*60_000 equals undici's default (300e3), so setting it explicitly is misleading. - bodyTimeout: 10*60_000 was a speculative bump with no evidence that any current FTR caller hits the 5-min default. The original failure was a ConnectTimeoutError, full stop. Also reverting the http branch back to a null dispatcher. Sibling patterns in kbn-test-saml-auth/fetch_kibana_version and kbn-synthtrace/cli/utils/ssl construct an https-only Agent and pass undefined for http; the original kbn-client code matched that idiom and no http caller has reported a stall. Net change vs main is now a single override: connect.timeout = 60s on the https Agent, plus the comment explaining why.
|
Pinging @elastic/obs-onboarding-team (Team:obs-onboarding) |
TamerlanG
approved these changes
May 25, 2026
steliosmavro
approved these changes
May 25, 2026
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Set
connect.timeout = 60son the undiciAgentused byKbnClientRequester(https path only).Why
#268531 migrated
KbnClientfrom axios to native fetch but did not override undici's 10sconnect.timeoutdefault. Axios had no equivalent cutoff, so FTR callers talking to a busy local Kibana started failing once that PR landed.The
kibana-streams-performanceweekly pipeline went red in builds #9, #11, #12, and #13 with:The
10000msis undici's default. Bisect: build #8 last green (2026-05-11) → #9 first red (2026-05-18), with #268531 in the window.What changed
src/platform/packages/shared/kbn-kbn-client/src/kbn_client/kbn_client_requester.ts: one constant, one option on the httpsAgent. http branch unchanged.Related
Regression introduced in #268531. Companion streams perf PR: #270636.
Validation
https://buildkite.com/elastic/kibana-streams-performance/builds/14