Skip to content

Commit b00b51d

Browse files
authored
[FTR] Configure undici timeouts on KbnClient dispatcher (elastic#270932)
## Summary Set `connect.timeout = 60s` on the undici `Agent` used by `KbnClientRequester` (https path only). ## Why elastic#268531 migrated `KbnClient` from axios to native fetch but did not override undici's 10s `connect.timeout` default. Axios had no equivalent cutoff, so FTR callers talking to a busy local Kibana started failing once that PR landed. The `kibana-streams-performance` weekly pipeline went red in builds #9, #11, #12, and #13 with: ``` ConnectTimeoutError: Connect Timeout Error (attempted address: localhost:5620, timeout: 10000ms) ``` The `10000ms` is undici's default. Bisect: build #8 last green (2026-05-11) → #9 first red (2026-05-18), with elastic#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 https `Agent`. http branch unchanged. ## Related Regression introduced in elastic#268531. Companion streams perf PR: elastic#270636. ## Validation https://buildkite.com/elastic/kibana-streams-performance/builds/14
1 parent b7a8104 commit b00b51d

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/platform/packages/shared/kbn-kbn-client/src/kbn_client/kbn_client_requester.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ interface Options {
118118
certificateAuthorities?: Buffer[];
119119
}
120120

121+
// undici's default `connect.timeout` is 10s. FTR talks to a local Kibana that
122+
// can take longer to accept a connection during heavy load (e.g. while
123+
// streaming a large multipart upload), and the previous axios-based requester
124+
// had no equivalent socket-connect cutoff. Restore that headroom.
125+
const FETCH_CONNECT_TIMEOUT_MS = 60_000;
126+
121127
export class KbnClientRequester {
122128
// `url` retains any `user:pass@` from the original config - `resolveUrl()` is
123129
// a public API used by FTR tests (e.g. http connector tests) that pluck
@@ -145,7 +151,13 @@ export class KbnClientRequester {
145151

146152
this.dispatcher =
147153
parsed.protocol === 'https:'
148-
? new Agent({ connect: { ca: options.certificateAuthorities, rejectUnauthorized: false } })
154+
? new Agent({
155+
connect: {
156+
ca: options.certificateAuthorities,
157+
rejectUnauthorized: false,
158+
timeout: FETCH_CONNECT_TIMEOUT_MS,
159+
},
160+
})
149161
: null;
150162
}
151163

0 commit comments

Comments
 (0)