Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that supported params are computed once #113953

Conversation

DaveCTurner
Copy link
Contributor

A few of today's REST handler implementations compute a new set of
supported parameters on each request. This is needlessly inefficient
since the set never changes. This commit fixes those implementations and
adds assertions to verify that we are returning the exact same instance
each time.

A few of today's REST handler implementations compute a new set of
supported parameters on each request. This is needlessly inefficient
since the set never changes. This commit fixes those implementations and
adds assertions to verify that we are returning the exact same instance
each time.
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Oct 2, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

Clever assert. LGTM.

@DaveCTurner DaveCTurner added the auto-backport-and-merge Automatically create backport pull requests and merge when ready label Oct 2, 2024
@DaveCTurner DaveCTurner merged commit 1964d3c into elastic:main Oct 2, 2024
16 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.x Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 113953

@DaveCTurner DaveCTurner deleted the 2024/10/02/supported-params-same-instance branch October 2, 2024 20:05
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Oct 2, 2024
A few of today's REST handler implementations compute a new set of
supported parameters on each request. This is needlessly inefficient
since the set never changes. This commit fixes those implementations and
adds assertions to verify that we are returning the exact same instance
each time.

Backport of elastic#113953 to `8.x`
gmarouli pushed a commit to gmarouli/elasticsearch that referenced this pull request Oct 3, 2024
A few of today's REST handler implementations compute a new set of
supported parameters on each request. This is needlessly inefficient
since the set never changes. This commit fixes those implementations and
adds assertions to verify that we are returning the exact same instance
each time.
elasticsearchmachine pushed a commit that referenced this pull request Oct 3, 2024
* Ensure that supported params are computed once

A few of today's REST handler implementations compute a new set of
supported parameters on each request. This is needlessly inefficient
since the set never changes. This commit fixes those implementations and
adds assertions to verify that we are returning the exact same instance
each time.

Backport of #113953 to `8.x`

* Fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport-and-merge Automatically create backport pull requests and merge when ready backport pending :Core/Infra/REST API REST infrastructure and utilities >non-issue Team:Core/Infra Meta label for core/infra team v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants