Consider adding a LazyResettableCts for Kestrel
Open
affected-very-few
area-networking
enhancement
severity-nice-to-have
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 276
Description
We have been bitten in the past in Kestrel by making the RequestAborted token lazy. We have now had 3 attempts to fix our disposal of the RequestAborted token (https://github.com/aspnet/AspNetCore/commit/e04c79bd3dfc0634af1ac6b578124630a5be247d, https://github.com/aspnet/AspNetCore/commit/0622513058eff9a4374a0edca726d2c62959ea1e, and another one from a while ago that I can't find), and though we think our logic is correct now, it isn't easy to guarantee and verify.
A nice way to simplify this logic is to create a new CTS type that is both lazy and resettable. Internally, it would handle races between calling cancel and dispose and be resettable.
Contributor guide
Assessment
This issue has not been assessed yet.