Skip to content

Associate tagged keys with entries so replacements are not evicted #61529

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

profet23
Copy link

@profet23 profet23 commented Apr 17, 2025

Associate tagged keys with entries so replacements are not evicted

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

MemoryOutputCacheStore will now only remove tags from the associated eviction, rather than all tags associated with the key.

Description

A previous PR (#43728) fixed a memory leak by removing tags upon eviction from the MemoryOutputCacheStore.

That fix created a bug where if an entry is replaced rather than evicted via timeout, the tags associated with the replacement would erroneously be deleted and the new entry would have no tags.

This PR associates each tag with a specific entry. When the PostEvictionCallback is run, only the associated tags with that specific eviction will be removed.

I based this on release/8.0 branch, I assume it can be merged into release/8.0, release/9.0, and main.

Fixes #61524

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Apr 17, 2025
@profet23 profet23 changed the base branch from main to release/8.0 April 17, 2025 03:33
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Apr 17, 2025
Copy link
Contributor

Hey @dotnet/aspnet-build, looks like this PR is something you want to take a look at.

@profet23 profet23 requested a review from gfoidl April 17, 2025 10:52
@martincostello
Copy link
Member

I based this on release/8.0 branch, I assume it can be merged into release/8.0, release/9.0, and main.

As a starting point this should target main. If it meets the servicing bar, then backporting it to other branches can be done by the team post-merge.

@profet23 profet23 force-pushed the profet23/issue_61524 branch from 3f4849d to ee019d9 Compare April 17, 2025 12:21
@profet23 profet23 requested a review from brunolins16 as a code owner April 17, 2025 12:21
@profet23 profet23 changed the base branch from release/8.0 to main April 17, 2025 12:21
@profet23
Copy link
Author

I based this on release/8.0 branch, I assume it can be merged into release/8.0, release/9.0, and main.

As a starting point this should target main. If it meets the servicing bar, then backporting it to other branches can be done by the team post-merge.

Done.

@profet23 profet23 requested a review from gfoidl April 17, 2025 12:23
Copy link
Member

@gfoidl gfoidl left a comment

Choose a reason for hiding this comment

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

Code changes LGTM.

Copy link
Contributor

Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime.
To make sure no conflicting changes have occurred, please rerun validation before merging. You can do this by leaving an /azp run comment here (requires commit rights), or by simply closing and reopening.

@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Apr 25, 2025
@profet23
Copy link
Author

/azp run

Copy link

Commenter does not have sufficient privileges for PR 61529 in repo dotnet/aspnetcore

@profet23
Copy link
Author

Anything more I need to do to get a review and keep this PR from going stale?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework community-contribution Indicates that the PR has been added by a community member pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MemoryOutputCacheStore doesn't respect "reason" for eviction and deletes tags erroneously
3 participants