Description
Currently in .NET 4.x HTTP responses are never streamed. Instead, the deserialized objects are streamed after the full HTTP response body is read into a buffer by the HttpClient. This results in a higher time-to-first-result in .NET 4.
This limitation is in place because:
- Different behaviors around HttpClient.Dispose in .NET 4 may cause IOExceptions (see
NCBC-3433) - HttpResponseMessage doesn't have a finalizer in .NET 4 so failure to dispose of the returned IQueryResult<T> (or similar) could cause HTTP connection leaks. When combined with the default limit of 2 connections per HTTP server in .NET 4 this could easily lead to outages.
We should address our Dispose patterns to avoid the first problem and then provide a way for users to opt-in to HTTP streaming in .NET 4 if they are aware of the second problem and properly dispose of returned IQueryResult<T>, IViewResult<T>, and IAnalyticsResult<T> objects.
https://www.couchbase.com/forums/t/streaming-result-of-queries/37043/8
Attachments
Issue Links
- is duplicated by
-
NCBC-3505 Disable HTTP streaming for HTTP services on .NET 4.X by default
- Closed