Skip to content
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

Synchronous request and response IO to be disallowed by default #252

Closed
halter73 opened this issue Jun 23, 2017 · 1 comment
Closed

Synchronous request and response IO to be disallowed by default #252

halter73 opened this issue Jun 23, 2017 · 1 comment

Comments

@halter73
Copy link
Member

halter73 commented Jun 23, 2017

Starting in ASP.NET Core 2.0.0 RTM, synchronous request and response IO will be disallowed by default.

For example, HttpContext.Request.Body.Read and HttpContext.Response.Body.Write will both throw InvalidOperationExceptions with a message communicating that either the equivalent async API should be called or synchronous IO should be explicitly allowed using IHttpBodyControlFeature.AllowSynchronousIO.

Synchronous IO hasn't been disallowed by default yet. After 2.0.0-preview2, there will be changes to both Kestrel and HttpSysServer to disallow this. Both servers will have a property added to their respective Options classes to globally allow synchronous IO.

Note: This change only impacts the request and response Stream APIs.


Please use aspnet/ServerTests#86 for further discussion.

@halter73 halter73 added this to the 2.0.0 milestone Jun 23, 2017
@aspnet aspnet locked and limited conversation to collaborators Jun 23, 2017
@halter73
Copy link
Member Author

We're closing this issue/announcement for now due to incompatibilities this introduces with existing BCL types that are either difficult or impossible to work around without fully buffering. We hope to introduce this breaking change in a future major release.

Feel free to continue using aspnet/ServerTests#86 for discussion.

@halter73 halter73 removed this from the 2.0.0 milestone Jun 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant