security: cache certificate expiration metrics as pointers#142682
Conversation
pkg/security/cert_expiry_cache.go
Outdated
There was a problem hiding this comment.
These two lines are the significant changes in the PR.
Changes in cockroachdb#130110 were added to add labelled ttl metrics to client certificates. It achieved this by changing the system which cached certificate expiries to cache on a composite struct of two metrics, rather than just an expiration metric. The struct itself housed the metrics as inline values, rather than pointers, so updates were registered in the cached values only, and not the registry in which they were reporting. This means that updates to client certificate expirations would not be reflected by the ttl or expiration metrics. This ticket modifies those elements so that they are not copied when they are pulled from the cache. Fixes: cockroachdb#142681 Epic: CRDB-40209 Release note (bug fix): Fixes bug in client certificate expiration metrics.
0f3d1fc to
2e872e2
Compare
dhartunian
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 0 LGTMs obtained
a discussion (no related file):
thanks Brian. Do we need some backport labels before this gets merged?
|
ah yes, good reminder! |
|
bors r+ |
|
Build succeeded: |
|
Based on the specified backports for this PR, I applied new labels to the following linked issue(s). Please adjust the labels as needed to match the branches actually affected by the issue(s), including adding any known older branches. Issue #142681: branch-release-24.1, branch-release-24.3. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
|
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from 2e872e2 to blathers/backport-release-24.1-142682: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 24.1.x failed. See errors above. error setting reviewers, but backport branch blathers/backport-release-24.3-142682 is ready: POST https://api.github.com/repos/cockroachdb/cockroach/pulls/142843/requested_reviewers: 422 Reviews may only be requested from collaborators. One or more of the teams you specified is not a collaborator of the cockroachdb/cockroach repository. [] Backport to branch 24.3.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
security: cache certificate expiration metrics as pointers
Changes in #130110 were added to add labelled ttl metrics to client certificates. It achieved this by changing the system which cached certificate expiries to cache on a composite struct of two metrics, rather than just an expiration metric.
The struct itself housed the metrics as inline values, rather than pointers, so updates were registered in the cached values only, and not the registry in which they were reporting. This means that updates to client certificate expirations would not be reflected by the ttl or expiration metrics.
This ticket modifies those elements so that they are not copied when they are pulled from the cache.
Fixes: #142681
Epic: CRDB-40209
Release note (bug fix): Fixes bug in client certificate expiration metrics.