-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose response PipeWriter in Kestrel #7110
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some feedback for myself and things to figure out.
src/Servers/Kestrel/Core/src/Internal/Http/Http1OutputProducer.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.FeatureCollection.cs
Show resolved
Hide resolved
src/Servers/Kestrel/shared/test/HttpResponseWritingExtensions.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/test/InMemory.FunctionalTests/Http2/Http2TestBase.cs
Show resolved
Hide resolved
Looks like swapping WriteAsync broke stuff too. I think they are issues with StreamPipeWriter so I'll investigate and create a separate PR. |
👀 |
src/Http/Http.Abstractions/src/Extensions/HttpResponseWritingExtensions.cs
Outdated
Show resolved
Hide resolved
2af90f9
to
6c906bd
Compare
/AzurePipelines run AspNetCore-benchmarking-pr |
Successfully queued 1 pipeline(s). |
src/Servers/Kestrel/Core/src/Internal/Http/Http1OutputProducer.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Core/src/Internal/Http/Http1OutputProducer.cs
Outdated
Show resolved
Hide resolved
Figured out why all response compression tests are failing. We are now double flushing the stream for ResponseCompression; once from StreamPipeWriter.FlushAsync, and another from BodyWrapperStream.FinishCompressionAsync (which calls Dispose), which causes extra compression frames to be written to the response. To fix this, either we need a way to either make the StreamPipeWriter not call FlushAsync on the underlying stream and only write the buffered contents to the stream (which may straight up break scenarios), or we need to fix the tests to expect a longer length (which isn't desired as it means response compression is less optimized). |
Go ahead and update the response compression tests (after verifying the data isn't corrupt and can round trip). An extra flush at the end isn't the end of the world. We do want to discourage frequent flushes though. |
src/Servers/Kestrel/Core/src/Internal/Http/Http1OutputProducer.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.FeatureCollection.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.FeatureCollection.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.FeatureCollection.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.FeatureCollection.cs
Outdated
Show resolved
Hide resolved
src/Http/Http.Abstractions/src/Extensions/HttpResponseWritingExtensions.cs
Outdated
Show resolved
Hide resolved
src/Http/Http.Abstractions/src/Extensions/HttpResponseWritingExtensions.cs
Outdated
Show resolved
Hide resolved
🆙 📅 . There is still some crust around the new Disposal logic I added, but I wanted to make sure it's a good idea before cleaning up. |
ad0f5db
to
67023fa
Compare
Bad merge. Fixing. |
src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.FeatureCollection.cs
Outdated
Show resolved
Hide resolved
1 error on
|
Fortunately Helix tests aren't required yet 😄 |
Remove local development item group accidentally added by dotnet#7110.
Remove local development item group accidentally added by #7110.
For #4351 and does many other things too that are required for this change.
Things left to do:
Have fun everyone 😄