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

Backport of metadata: memoize the parsed build versions into release/1.20.x #22118

Open
wants to merge 4 commits into
base: release/1.20.x
Choose a base branch
from

Conversation

hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #22113 to be assessed for backporting due to the inclusion of the label backport/1.20.

The below text is copied from the body of the original PR.


Description

There will only be a small set of consul build versions that a single consul server will witness. Inside of metadata.IsConsulServer we use a very expensive function in the hashicorp/go-version library to parse these into read-only *version.Version structs all over Consul.

Memoize these in a package cache map. Likely the thing will only have like 2 keys in it ever over the life of the process.


Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core requested a review from a team as a code owner February 3, 2025 22:22
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/rboyer/memoize-build-version/seriously-primary-narwhal branch from 8dd62d6 to 561d2cc Compare February 3, 2025 22:22
Copy link
Collaborator

Choose a reason for hiding this comment

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

Auto approved Consul Bot automated PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants