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

Produce warning when async work isn't tracked #29

Open
AArnott opened this issue Feb 22, 2018 · 0 comments
Open

Produce warning when async work isn't tracked #29

AArnott opened this issue Feb 22, 2018 · 0 comments

Comments

@AArnott
Copy link
Member

AArnott commented Feb 22, 2018

If ThreadHelper.JoinableTaskFactory.RunAsync is called and the JoinableTask returned isn't tracked anywhere, that represents unmonitored async work that can crash if still running when VS shuts down the CLR. Folks should follow a pattern of tracking their async work.
This is actually more general to all async methods invoked but not awaited or assigned to something.

Note that some JTF instances are associated with a JoinableTaskCollection that tracks the async work implicitly and that shouldn't produce a warning.

Maybe this should go into the vs-threading library, except perhaps not all apps are as sensitive to untracked async work as VS is. Also, we may want to special case well-known JTF instances such as the one on ThreadHelper to know that that is not a tracking one and should therefore be flagged.

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

No branches or pull requests

1 participant