dotnet / dotnet/aspnetcore

NotifyOnCompleted does not catch exceptions, may abort the response/connection

Open
#5,885 3 comments 0 reactions 0 assignees View on GitHub
affected-very-few area-networking bug feature-httpsys help wanted severity-nice-to-have
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

NotifyOnCompleted should catch and log its own exceptions as to not disrupt the normal request flow. It doesn't.

https://github.com/aspnet/HttpSysServer/blob/336e85d19abcdf3ec3a024cb9431c768a4e5d494/src/Microsoft.AspNetCore.Server.HttpSys/MessagePump.cs#L204-L214
https://github.com/aspnet/HttpSysServer/blob/336e85d19abcdf3ec3a024cb9431c768a4e5d494/src/Microsoft.AspNetCore.Server.HttpSys/FeatureContext.cs#L586-L591

It also fires before the response is flushed/disposed so these exceptions may abort the response/connection.
Compare to https://github.com/aspnet/KestrelHttpServer/pull/2324

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.