Skip to content

[8.19] Expose isRetryableEsClientError (#228315)#244762

Merged
rudolf merged 9 commits intoelastic:8.19from
rudolf:backport/8.19/pr-228315
Dec 23, 2025
Merged

[8.19] Expose isRetryableEsClientError (#228315)#244762
rudolf merged 9 commits intoelastic:8.19from
rudolf:backport/8.19/pr-228315

Conversation

@rudolf
Copy link
Contributor

@rudolf rudolf commented Dec 1, 2025

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

## Summary

For plugins to have robust error handling they need to retry transient
errors. This PR exposes `isRetryableEsClientError` utility to help
plugins know which errors are safe to retry.

## Note for reviewers
Core's isRetryableEsClientError typically retries on more status codes
than what most plugins do. Instead of keeping the existing plugin status
codes I've adopted the default behavior which means your plugins will be
retrying on more types of responses after this change. Carefully check
that this makes sense.

In particular the two following status codes get retried that plugins
weren't previously retrying:
 *   - 429 TooManyRequests (ES circuit breaker)
* - 504 GatewayTimeout (rare, but happens if cloud proxy cannot
establish socket connection to ES due to ES thread pool being
overloaded)

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit c499684)

# Conflicts:
#	src/core/packages/elasticsearch/server-internal/src/is_scripting_enabled.test.ts
#	src/core/packages/saved-objects/migration-server-internal/src/actions/catch_retryable_es_client_errors.ts
#	x-pack/platform/plugins/shared/alerting/tsconfig.json
#	x-pack/platform/plugins/shared/cases/server/cases_analytics/tasks/synchronization_task/synchronization_sub_task.ts
#	x-pack/platform/plugins/shared/cases/server/cases_analytics/utils.ts
#	x-pack/platform/plugins/shared/cases/tsconfig.json
#	x-pack/platform/plugins/shared/streams/tsconfig.json
#	x-pack/solutions/observability/plugins/observability/tsconfig.json
#	x-pack/solutions/observability/plugins/slo/tsconfig.json
#	x-pack/solutions/security/plugins/security_solution/tsconfig.json
@rudolf rudolf requested a review from kibanamachine as a code owner December 1, 2025 12:39
@rudolf rudolf added the backport This PR is a backport of another PR label Dec 1, 2025
@rudolf rudolf enabled auto-merge (squash) December 1, 2025 12:39
@rudolf rudolf mentioned this pull request Dec 1, 2025
10 tasks
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

Copy link
Contributor

@gsoldevila gsoldevila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-approving hoping for green CI

@rudolf rudolf merged commit 18a006e into elastic:8.19 Dec 23, 2025
13 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/core-elasticsearch-server-internal 33 32 -1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kbnUiSharedDeps-srcJs 3.7MB 3.7MB -129.0B
Unknown metric groups

API count

id before after diff
@kbn/core-elasticsearch-server-internal 38 36 -2
@kbn/core-elasticsearch-server-utils - 3 +3
total +1

ESLint disabled line counts

id before after diff
securitySolution 608 607 -1

Total ESLint disabled count

id before after diff
securitySolution 696 695 -1

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:obs-ux-management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants