dotnet/releases/net471/KnownIssues/534719-Networking ServicePo...

75 lines
3.3 KiB
Markdown
Raw Normal View History

Update 4.7.2 branch with changes to master (#635) * Corrected category to remove duplication, generated readme (#542) * Fixed bad links (#543) * Making relative link use home operation (#544) * Link fixes (#545) * fixed xrefs and links * reverted change * Update the issue with the list of types potentially impacted (#538) * Update the issue with the list of types potentially impacted * Update 510901-BCL Apps targeting .NET-4.6.1 that use .NET Standard libraries might be broken when running on .NET 4.7.1.md * Update 510901-BCL Apps targeting .NET-4.6.1 that use .NET Standard libraries might be broken when running on .NET 4.7.1.md * Update 510901-BCL Apps targeting .NET-4.6.1 that use .NET Standard libraries might be broken when running on .NET 4.7.1.md * Update 510901-BCL Apps targeting .NET-4.6.1 that use .NET Standard libraries might be broken when running on .NET 4.7.1.md * Update 510901-BCL Apps targeting .NET-4.6.1 that use .NET Standard libraries might be broken when running on .NET 4.7.1.md (#546) * Add Neutronium reference (#547) * Adding Neutronium link * As by PR * Create 521954 - BCL CultureAwareComparer with ignore casing on serial… (#553) * Create 521954 - BCL CultureAwareComparer with ignore casing on serialized on previous versions of .NET do not correctly deserialize on .NET 4.7.1.md * Update 521954 - BCL CultureAwareComparer with ignore casing on serialized on previous versions of .NET do not correctly deserialize on .NET 4.7.1.md * Update 521954 - BCL CultureAwareComparer with ignore casing on serialized on previous versions of .NET do not correctly deserialize on .NET 4.7.1.md * Update known issues for #521954 * Update 521954 - BCL CultureAwareComparer with ignore casing on serial… (#555) * Update 521954 - BCL CultureAwareComparer with ignore casing on serialized on previous versions of .NET do not correctly deserialize on .NET 4.7.1.md * Update 521954 - BCL CultureAwareComparer with ignore casing on serialized on previous versions of .NET do not correctly deserialize on .NET 4.7.1.md * Update 521954 - BCL CultureAwareComparer with ignore casing on serialized on previous versions of .NET do not correctly deserialize on .NET 4.7.1.md (#558) LGTM * Update 521954 - BCL CultureAwareComparer with ignore casing on serialized on previous versions of .NET do not correctly deserialize on .NET 4.7.1.md * Typo fix (#554) * Add known issue for 523633 (#559) * Add known issue for 523633 * Add known issue for 523633 * Fixes for review comments for 523633 * Fixes for review comments for 523633 * Changes so content syncs with PR #3686 in dotnet/docs (#561) * Added Core WF and Orleans.Activities (#562) * Update platforms.json Update .NET Core entries to include the November Update release. * Added release notes for 6.0.2 * Update README.md * Update README.md * Update README.md * Adding Known Issue for the 471 stack trace perf issue (#567) * Adding Known Issue for the 471 stack trace perf issue * Incorporated review comments * Update dotnet471-known-issues.md * Add ServicetStack to frameworks list (#574) Adding in link to the ServiceStack web framework (which I am not involved with or a representative of, but that I use and have contributed minor tweaks to) * Miscellanous formatting fixes (#573) * Miscellanous formatting fixes * Corrected quirked/build time break sections * 2.0.2 release notes * 1.7.2 release notes * readability fixes * Resolving PR feedback * Resolving PR feedback * Resolving PR feedback * Converted asset IDs to xrefs, corrected formatting (#581) * Add .NET 4.7.1 Networking known issue 534719 (#580) * Add .NET 4.7.1 Networking known issue 534719 Add known issue document for bug 534719-Networking ServicePoint.ConnectionLimit default behavior with loopback changed unexpectedly. * Addressed PR feedback * Removed duplicate words (#583) * Add release notes for UWP 6.0.5 * Add more consistency to net-native1.7 readme * Replaced unprintable characters. (#586) * Fixed links broken in dotnet/docs (#588) * Updated the readme with the 5.2.4 release. * Updated README with the 5.3.5 release * Updated the README with the 5.4.2 release * Updated README with 6.0.6 release. * Added the link for ZDP update for Known Issues fixed by it. (#595) * Added the link for ZDP update for Known Issues fixed by it. * Added platform information * Added Switch.System.Net.DontEnableSystemDefaultTlsVersions AppContext switch (#603) * Replaced MSDN link with link to docs.microsoft.com * Corrected typos * Added Switch.System.Net.DontEnableSystemDefaultTlsVersions switch * Clarify Portable PDB feature disabled in 4.7.1 (#606) * Update guidance for Portable PDB in 4.7.1 (#607) * Update guidance for Portable PDB in 4.7.1 * Address review feedback * More review feedback * Added new known issue for 517815-BCL * Add known issue for 470006 - GC large object crashes Added a known issue, written by Chris Ahna, about GC crashes when we have a high rate of large object allocations and frees. * Updated to include proposed changes from review * Updated to incorporate feedback * fixed formatting (#614) * fixed formatting (hopefully) * Fixed links broken after migration * Documented two .NET Framework 4.6 app compat switches (#615) * Documented DontEnableSchSendAuxRecord switch * added note * added second switch * Finished documenting switches * Added readme * Fixed formatting issues * Adding additional fix info (#616) * Adding additional fix info Adding info for the Fall Creators Update patch * Update 517815-BCL Applications making heavy use of System.Diagnostics.StackTrace might run more slowly on .NET 4.7.1.md * Update 517815-BCL Applications making heavy use of System.Diagnostics.StackTrace might run more slowly on .NET 4.7.1.md Fixing links (copy/pasting doesn't format them correctly) * Update 517815-BCL Applications making heavy use of System.Diagnostics.StackTrace might run more slowly on .NET 4.7.1.md Minor changes * Update .NET UWP release notes for 6.0.7 release * fixed based on feedback. * Fix inline code span (#618) * Fix inline code ' -> ` * Update wpf-selector-crash-when-removing-item-from-custom-collection.md * Fixed formatting of opening XML tag (#622) * Update known issue 517815-BCL Stack traces are missing source information (#623) * Update 517815-BCL Stack traces are missing source information for frames with debug information in the Portable PDB format.md Add the portable PDB conversion tool as a workaround now that it is better documented how to use it. * Update 517815-BCL Stack traces are missing source information for frames with debug information in the Portable PDB format.md PR feedback * Assorted changes (#625) * Assorted changes * Removed remaining occurences of 'en-us' * Removed comments (#628) * Fix compat doc links (#632) * ~/docsframework -> ~/docs/framework * fix bookmark: #Networking.md -> #Networking * fix bookmark: #mitigation.md -> #mitigation * Fixing index.md URI (#633)
2018-02-27 10:55:52 +08:00
# ServicePoint.ConnectionLimit default behavior with loopback changed unexpectedly
## Symptoms
The limit for HTTP connections per endpoint is controlled by the `ServicePointManager.DefaultConnectionLimit` property.
This value defaults to 2. In the .NET Framework 4.7 and earlier versions, the limit applied only to non-loopback
addresses such as http://www.microsoft.com. For loopback addresses such as http://localhost, the limit for connections
was always int.MaxValue (2,147,483,647) unless changed by calling the `ServicePoint.ConnectionLimit` API.
In the .NET Framework 4.7.1 when using HttpClient APIs, the connection limit for loopback addresses now matches the limit
for non-loopback addresses. Thus, the default limit is 2. This can cause applications to run slower or hang when
doing multiple, parallel, requests to the http://localhost addresses.
Here is code that shows the problem:
```c#
using System;
using System.Net;
using System.Net.Http;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine($"ServicePointManager.DefaultConnectionLimit: {ServicePointManager.DefaultConnectionLimit}");
var uriLoopback = new Uri("http://localhost");
var uriExternal = new Uri("http://www.microsoft.com");
Console.WriteLine("Before using HttpClient APIs");
ServicePoint spLoopback = ServicePointManager.FindServicePoint(uriLoopback);
Console.WriteLine($"{uriLoopback.AbsoluteUri}, ConnectionLimit (should be {int.MaxValue}): {spLoopback.ConnectionLimit}");
ServicePoint spExternal = ServicePointManager.FindServicePoint(uriExternal);
Console.WriteLine($"{uriExternal.AbsoluteUri}, ConnectionLimit (should be {ServicePointManager.DefaultConnectionLimit}): {spExternal.ConnectionLimit}");
Console.WriteLine("Use HttpClient APIs");
var client = new HttpClient();
try
{
HttpResponseMessage response = client.GetAsync(uriLoopback).Result;
}
catch (Exception)
{
// Ignore any network error since there is probably not a loopback server present.
}
Console.WriteLine("After using HttpClient APIs");
// BUG - due to the bug in .NET Framework 4.7.1, the ConnectionLimit for this loopback ServicePoint is changed
// unexpectedly.
Console.WriteLine($"{uriLoopback.AbsoluteUri}, ConnectionLimit (should be {int.MaxValue}): {spLoopback.ConnectionLimit}");
}
}
}
```
## Cause
Changes in .NET Framework 4.7.1 to the `System.Net.Http.HttpClientHandler` class caused this problem.
## Resolution
To work around the problem using HttpClient APIs, you can use the following code to increase the connection limit.
This code should be added before calling any HttpClient APIs.
```c#
ServicePointManager.DefaultConnectionLimit = 20; // Actual value should be based on your requirements.
```
Note: This will also change the limits for non-loopback addresses.
## More information
This issue was fixed in the [August 2018 Security and Quality Rollup](https://blogs.msdn.microsoft.com/dotnet/2018/08/14/august-2018-security-and-quality-rollup/).
Installing this or later updates will correct the problem.