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

Task delay with infinite timespan is leaking memory #26

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

Conversation

tomasevicius
Copy link

Task.Delay with infinite timespan is neither awaited nor cancelled thus stays running forever and leaks CancellationTokenRegistration object defined in DelayPromiseWithCancellation.

@ailtonguitar
Copy link
Contributor

Hi @tomasevicius ! Thanks for your contribution!

Is it possible to create tests to cover this scenario? Also, can you share the benchmark results?

@tomasevicius
Copy link
Author

Hi @tomasevicius ! Thanks for your contribution!

Is it possible to create tests to cover this scenario? Also, can you share the benchmark results?

Hi, this change is not modifying any functionality, it is purely technical, thus existing tests should be enough.
I don't think I can create a meaningful test to prove that a function used and properly disposed a resource (Task in this case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants