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

[release/8.0] Delete the RequiresPreviewFeaturesAttribute from RefreshMemoryLimit #91688

Merged

Conversation

cshung
Copy link
Member

@cshung cshung commented Sep 6, 2023

Backport of #91622 to release/8.0

Customer Impact

This is to enable the RefreshMemoryLimit feature so that it won't require the RequiresPreviewFeaturesAttribute. This is going to be used by Amazon Lambda here.

Testing

The internal working is tested by enabling the COMMITTED_BYTES_SHADOW feature switch - the switch will trigger a call to RefreshMemoryLimit for each GC, and it was run as part of the GC exit criteria run.

The managed part of the method is not currently tested, work is in progress to provide some coverage through #91833.

Risk

The API is already public, this change does not add any more risk for customers who will call it regardless of the existence of a warning or not.

@dotnet-issue-labeler dotnet-issue-labeler bot added needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners new-api-needs-documentation labels Sep 6, 2023
@ghost ghost assigned cshung Sep 6, 2023
@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@cshung cshung added area-System.Runtime and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Sep 6, 2023
@ghost
Copy link

ghost commented Sep 6, 2023

Tagging subscribers to this area: @dotnet/area-system-runtime
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: cshung
Assignees: cshung
Labels:

area-System.Runtime, new-api-needs-documentation, needs-area-label

Milestone: -

@teo-tsirpanis teo-tsirpanis added this to the 8.0.0 milestone Sep 6, 2023
@cshung cshung force-pushed the public/delete-attribute-backport branch from 8aab152 to e23f90b Compare September 7, 2023 15:54
@stephentoub
Copy link
Member

Are there tests somewhere for GC.RefreshMemoryLimit()? I'm not seeing any.

@cshung
Copy link
Member Author

cshung commented Sep 8, 2023

Are there tests somewhere for GC.RefreshMemoryLimit()? I'm not seeing any.

If we turn on #define COMMITTED_BYTES_SHADOW, this will stress test the RefreshMemoryLimit() before every GC. We tested it that way.

@stephentoub
Copy link
Member

stephentoub commented Sep 8, 2023

If we turn on #define COMMITTED_BYTES_SHADOW, this will stress test the RefreshMemoryLimit() before every GC. We tested it that way.

It calls the managed method, or the underlying functionality? If I were to change the managed method to nop or throw accidentally, what test would fail? And if the answer is "none", that's ok?

@cshung
Copy link
Member Author

cshung commented Sep 9, 2023

If we turn on #define COMMITTED_BYTES_SHADOW, this will stress test the RefreshMemoryLimit() before every GC. We tested it that way.

It calls the managed method, or the underlying functionality? If I were to change the managed method to nop or throw accidentally, what test would fail? And if the answer is "none", is that ok?

You are right, if someone nop the method, no test will detect that failure.

From a risk perspective, it is so much easier for a GC dev to forget hard limit could be changed and therefore write incompatible code than someone nop the managed method, that's why testing has been focused there. There are some glue code at the qcall layer that won't be exercised without a test calling from the managed side as well.

I think there is value to add a managed test, let me add one.

@carlossanlop
Copy link
Member

@cshung can you please fill out the servicing template from the PR description and get an M2 approval when this is ready to merge?

@cshung cshung force-pushed the public/delete-attribute-backport branch from e23f90b to bf805b3 Compare September 13, 2023 15:40
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved. this can be merged when ready

@carlossanlop carlossanlop merged commit e9464f7 into dotnet:release/8.0 Sep 14, 2023
172 checks passed
@cshung cshung deleted the public/delete-attribute-backport branch September 14, 2023 16:47
@radical radical mentioned this pull request Sep 26, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants