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

DataProtection Package is unusable in 3.0 #13696

Closed
smitpatel opened this issue Sep 4, 2019 · 3 comments
Closed

DataProtection Package is unusable in 3.0 #13696

smitpatel opened this issue Sep 4, 2019 · 3 comments
Assignees
Labels
area-dataprotection Includes: DataProtection

Comments

@smitpatel
Copy link
Contributor

https://github.com/aspnet/AspNetCore/blob/3dee6782c3f8d611b3cda871b97778a34121df83/src/DataProtection/EntityFrameworkCore/src/EntityFrameworkCoreXmlRepository.cs#L41-L48

Query above uses a client method in projection
Client method is instance method, hence the object of enclosing class would end up in EF Core query cache.
https://github.com/aspnet/AspNetCore/blob/3dee6782c3f8d611b3cda871b97778a34121df83/src/DataProtection/EntityFrameworkCore/src/EntityFrameworkCoreXmlRepository.cs#L68-L79

The repository contains IServiceProvider & ILogger which will cause memory leak.

In 3.0, EF Core started throwing exception for potential code which can cause such leak. Which generated dotnet/efcore#17623 (comment) from customer.
So currently, this code path is unusable and there is no way for customers to work-around it.

@smitpatel smitpatel added the area-dataprotection Includes: DataProtection label Sep 4, 2019
@smitpatel smitpatel changed the title Query causing memory leak DataProtection Package is unusable in 3.0 Sep 4, 2019
@smitpatel
Copy link
Contributor Author

Also given that it was not captured in any tests in the repo, there is lacking test coverage on this code path.

@blowdart
Copy link
Contributor

blowdart commented Sep 5, 2019

@Pilchie / @anurse no-one is a data protection dev right now. Can you assign someone?

@jkotalik
Copy link
Contributor

jkotalik commented Sep 5, 2019

The data protection package doesn't seem to have any true "functional" tests with EF. We use a test DataProtectionKeyContext https://github.com/aspnet/AspNetCore/blob/master/src/DataProtection/EntityFrameworkCore/test/DataProtectionKeyContext.cs#L8-L13.

As this issue seems high priority, I can look at it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-dataprotection Includes: DataProtection
Projects
None yet
Development

No branches or pull requests

3 participants