Skip to content

Produce warning when async work isn't tracked #29

@AArnott

Description

@AArnott

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions