fix(cache): return value copy when loading env#8880
Merged
Conversation
Contributor
|
❗ By default, the pull request is configured to backport to all release branches.
|
Member
Author
|
/test limit=local |
Contributor
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/18620322863 |
armru
commented
Oct 18, 2025
leonardoce
approved these changes
Oct 20, 2025
Contributor
|
/test |
Contributor
|
@leonardoce, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/18646419003 |
mnencia
approved these changes
Oct 20, 2025
a38b9d6 to
29fbc18
Compare
Make `LoadEnv` copy cached environment slices before returning so callers can't mutate the shared backing array. Add a regression test to ensure mutations to the returned slice don't leak back into the cache. Signed-off-by: Armando Ruocco <armando.ruocco.dev@gmail.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
29fbc18 to
2716a26
Compare
cnpg-bot
pushed a commit
that referenced
this pull request
Oct 20, 2025
Make `LoadEnv` copy cached environment slices before returning so callers can't mutate the shared backing array. Add a regression test to ensure mutations to the returned slice don't leak back into the cache. Signed-off-by: Armando Ruocco <armando.ruocco.dev@gmail.com> Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> (cherry picked from commit 93f02f4)
cnpg-bot
pushed a commit
that referenced
this pull request
Oct 20, 2025
Make `LoadEnv` copy cached environment slices before returning so callers can't mutate the shared backing array. Add a regression test to ensure mutations to the returned slice don't leak back into the cache. Signed-off-by: Armando Ruocco <armando.ruocco.dev@gmail.com> Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> (cherry picked from commit 93f02f4)
cnpg-bot
pushed a commit
that referenced
this pull request
Oct 20, 2025
Make `LoadEnv` copy cached environment slices before returning so callers can't mutate the shared backing array. Add a regression test to ensure mutations to the returned slice don't leak back into the cache. Signed-off-by: Armando Ruocco <armando.ruocco.dev@gmail.com> Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> (cherry picked from commit 93f02f4)
THE-BRAHMA
pushed a commit
to THE-BRAHMA/cloudnative-pg
that referenced
this pull request
Oct 30, 2025
Make `LoadEnv` copy cached environment slices before returning so callers can't mutate the shared backing array. Add a regression test to ensure mutations to the returned slice don't leak back into the cache. Signed-off-by: Armando Ruocco <armando.ruocco.dev@gmail.com> Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com> Signed-off-by: theBrahma <office.utpal.brahma@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make
LoadEnvcopy cached environment slices before returning so callers can't mutate the shared backing array. Add a regression test to ensure mutations to the returned slice don't leak back into the cache.