microsoft / service-fabric-aspnetcore

This repo contains ASP.NET Core integration for Service Fabric Reliable Services.
Other
152 stars 49 forks source link

Loss of AsyncLocal<> context while serializing/deserializing #106

Open Earelith opened 1 year ago

Earelith commented 1 year ago

Describe the bug I use in my project an AsyncLocal<> state object instanciated in kestrel middleware pipeline. When kestrel deserialize or serialize json objects, AsyncLocal<> state object is NULL when I launch a stress test.

To Reproduce I've created a thread on stack overflow with all code snippets here Let me know if I need to copy/paste the content.

Expected behavior I would expect AsyncLocal<> state not to be null as serialization/deserialization occurs after entering middleware, not before.