dotnet / dotnet/aspnetcore

Consider adding a LazyResettableCts for Kestrel

Open
#9,419 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.