Skip to content

ConnectHelper.ConnectEventArgs shouldn't capture AsyncLocals #26618

@smbecker

Description

@smbecker

I am still working on a minimal repro but I am running into cases where using the new SocketsHttpHandler is causing AsyncLocal values to be captured and cached in s_connectEventArgs causing those AsyncLocal values to live forever. At the moment, I have worked around the issue by calling ExecutionContext.SuppressFlow prior to making any calls to the HttpClient but this doesn't feel like the right solution. Perhaps the flow suppression should be moved to the ConnectHelper?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions