Skip to content

Make ResponseCompression call DisposeAsync #4604

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

Merged
merged 1 commit into from
Dec 12, 2018
Merged

Conversation

Tratcher
Copy link
Member

aspnet/BasicMiddleware#247

GZipStream.Dispose calls sync Write and Flush. This causes threads to get blocked and can starve the threadpool. In 3.0 we can call the new DisposeAsync instead.

@Tratcher Tratcher added this to the 3.0.0-preview2 milestone Dec 12, 2018
@Tratcher Tratcher self-assigned this Dec 12, 2018
@@ -39,13 +39,9 @@ internal class BodyWrapperStream : Stream, IHttpBufferingFeature, IHttpSendFileF
_innerSendFileFeature = innerSendFileFeature;
}

protected override void Dispose(bool disposing)
internal ValueTask FinishCompressionAsync()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add a regression test verifying that disposing the ResponseCompression stream doesn't end/poison the stream anymore.

@Tratcher Tratcher merged commit a08f4b5 into master Dec 12, 2018
@Tratcher Tratcher deleted the tratcher/compress branch December 12, 2018 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants