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

Merging internal commits for release/7.0 #51266

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-efcore -->
<add key="darc-int-dotnet-efcore-8133d0c" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-efcore-8133d0c8/nuget/v3/index.json" />
<add key="darc-int-dotnet-efcore-c20ecc7" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-efcore-c20ecc79/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-efcore -->
<!-- Begin: Package sources from dotnet-runtime -->
<add key="darc-int-dotnet-runtime-ecb34f8" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-runtime-ecb34f85/nuget/v3/index.json" />
<add key="darc-int-dotnet-runtime-4a824ef" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-runtime-4a824ef3/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-runtime -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
Expand All @@ -26,10 +26,10 @@
<clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-efcore -->
<add key="darc-int-dotnet-efcore-8133d0c" value="true" />
<add key="darc-int-dotnet-efcore-c20ecc7" value="true" />
<!-- End: Package sources from dotnet-efcore -->
<!-- Begin: Package sources from dotnet-runtime -->
<add key="darc-int-dotnet-runtime-ecb34f8" value="true" />
<add key="darc-int-dotnet-runtime-4a824ef" value="true" />
<!-- End: Package sources from dotnet-runtime -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
</disabledPackageSources>
Expand Down
420 changes: 210 additions & 210 deletions eng/Baseline.Designer.props

Large diffs are not rendered by default.

208 changes: 104 additions & 104 deletions eng/Baseline.xml

Large diffs are not rendered by default.

62 changes: 31 additions & 31 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@
-->
<Dependencies>
<ProductDependencies>
<Dependency Name="dotnet-ef" Version="7.0.11">
<Dependency Name="dotnet-ef" Version="7.0.12">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>8133d0c827462d8d84e47b70f294fc060a5d7a84</Sha>
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.11">
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.12">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>8133d0c827462d8d84e47b70f294fc060a5d7a84</Sha>
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="7.0.11">
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="7.0.12">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>8133d0c827462d8d84e47b70f294fc060a5d7a84</Sha>
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.11">
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.12">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>8133d0c827462d8d84e47b70f294fc060a5d7a84</Sha>
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.11">
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.12">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>8133d0c827462d8d84e47b70f294fc060a5d7a84</Sha>
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="7.0.11">
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="7.0.12">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>8133d0c827462d8d84e47b70f294fc060a5d7a84</Sha>
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore" Version="7.0.11">
<Dependency Name="Microsoft.EntityFrameworkCore" Version="7.0.12">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>8133d0c827462d8d84e47b70f294fc060a5d7a84</Sha>
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.Design" Version="7.0.11">
<Dependency Name="Microsoft.EntityFrameworkCore.Design" Version="7.0.12">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
<Sha>8133d0c827462d8d84e47b70f294fc060a5d7a84</Sha>
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
Expand Down Expand Up @@ -177,9 +177,9 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>d099f075e45d2aa6007a22b71b45a08758559f80</Sha>
</Dependency>
<Dependency Name="Microsoft.Internal.Runtime.AspNetCore.Transport" Version="7.0.11-servicing.23424.27">
<Dependency Name="Microsoft.Internal.Runtime.AspNetCore.Transport" Version="7.0.12-servicing.23477.20">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>ecb34f85ec92e1b3c814edf7da83337e199e7f66</Sha>
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
</Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="7.0.0-alpha.1.22505.1">
<Uri>https://github.com/dotnet/source-build-externals</Uri>
Expand Down Expand Up @@ -256,39 +256,39 @@
</Dependency>
<Dependency Name="System.Threading.RateLimiting" Version="7.0.1">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>ecb34f85ec92e1b3c814edf7da83337e199e7f66</Sha>
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.DependencyModel" Version="7.0.0">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>d099f075e45d2aa6007a22b71b45a08758559f80</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App.Ref" Version="7.0.11">
<Dependency Name="Microsoft.NETCore.App.Ref" Version="7.0.12">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>ecb34f85ec92e1b3c814edf7da83337e199e7f66</Sha>
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.MonoAOTCompiler.Task" Version="7.0.11">
<Dependency Name="Microsoft.NET.Runtime.MonoAOTCompiler.Task" Version="7.0.12">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>ecb34f85ec92e1b3c814edf7da83337e199e7f66</Sha>
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Runtime.WebAssembly.Sdk" Version="7.0.11">
<Dependency Name="Microsoft.NET.Runtime.WebAssembly.Sdk" Version="7.0.12">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>ecb34f85ec92e1b3c814edf7da83337e199e7f66</Sha>
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
</Dependency>
<!--
Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime.
All Runtime.$rid packages should have the same version.
-->
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="7.0.11">
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="7.0.12">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>ecb34f85ec92e1b3c814edf7da83337e199e7f66</Sha>
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm" Version="7.0.11">
<Dependency Name="Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm" Version="7.0.12">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>ecb34f85ec92e1b3c814edf7da83337e199e7f66</Sha>
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="7.0.11-servicing.23424.27">
<Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="7.0.12-servicing.23477.20">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
<Sha>ecb34f85ec92e1b3c814edf7da83337e199e7f66</Sha>
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
</Dependency>
<Dependency Name="Microsoft.Web.Xdt" Version="7.0.0-preview.22423.2">
<Uri>https://github.com/dotnet/xdt</Uri>
Expand Down
30 changes: 15 additions & 15 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@
<PropertyGroup Label="Automated">
<!-- Packages from dotnet/runtime -->
<MicrosoftExtensionsDependencyModelVersion>7.0.0</MicrosoftExtensionsDependencyModelVersion>
<MicrosoftNETCoreAppRefVersion>7.0.11</MicrosoftNETCoreAppRefVersion>
<MicrosoftNETCoreAppRuntimewinx64Version>7.0.11</MicrosoftNETCoreAppRuntimewinx64Version>
<MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>7.0.11</MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>
<MicrosoftNETRuntimeWebAssemblySdkVersion>7.0.11</MicrosoftNETRuntimeWebAssemblySdkVersion>
<MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>7.0.11</MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>
<MicrosoftNETCoreBrowserDebugHostTransportVersion>7.0.11-servicing.23424.27</MicrosoftNETCoreBrowserDebugHostTransportVersion>
<MicrosoftNETCoreAppRefVersion>7.0.12</MicrosoftNETCoreAppRefVersion>
<MicrosoftNETCoreAppRuntimewinx64Version>7.0.12</MicrosoftNETCoreAppRuntimewinx64Version>
<MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>7.0.12</MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>
<MicrosoftNETRuntimeWebAssemblySdkVersion>7.0.12</MicrosoftNETRuntimeWebAssemblySdkVersion>
<MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>7.0.12</MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>
<MicrosoftNETCoreBrowserDebugHostTransportVersion>7.0.12-servicing.23477.20</MicrosoftNETCoreBrowserDebugHostTransportVersion>
<MicrosoftExtensionsCachingAbstractionsVersion>7.0.0</MicrosoftExtensionsCachingAbstractionsVersion>
<MicrosoftExtensionsCachingMemoryVersion>7.0.0</MicrosoftExtensionsCachingMemoryVersion>
<MicrosoftExtensionsConfigurationAbstractionsVersion>7.0.0</MicrosoftExtensionsConfigurationAbstractionsVersion>
Expand Down Expand Up @@ -103,7 +103,7 @@
<MicrosoftExtensionsOptionsDataAnnotationsVersion>7.0.0</MicrosoftExtensionsOptionsDataAnnotationsVersion>
<MicrosoftExtensionsOptionsVersion>7.0.1</MicrosoftExtensionsOptionsVersion>
<MicrosoftExtensionsPrimitivesVersion>7.0.0</MicrosoftExtensionsPrimitivesVersion>
<MicrosoftInternalRuntimeAspNetCoreTransportVersion>7.0.11-servicing.23424.27</MicrosoftInternalRuntimeAspNetCoreTransportVersion>
<MicrosoftInternalRuntimeAspNetCoreTransportVersion>7.0.12-servicing.23477.20</MicrosoftInternalRuntimeAspNetCoreTransportVersion>
<SystemConfigurationConfigurationManagerVersion>7.0.0</SystemConfigurationConfigurationManagerVersion>
<SystemDiagnosticsDiagnosticSourceVersion>7.0.2</SystemDiagnosticsDiagnosticSourceVersion>
<SystemDiagnosticsEventLogVersion>7.0.0</SystemDiagnosticsEventLogVersion>
Expand All @@ -125,14 +125,14 @@
<!-- Only listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
<MicrosoftNETCorePlatformsVersion>7.0.4</MicrosoftNETCorePlatformsVersion>
<!-- Packages from dotnet/efcore -->
<dotnetefVersion>7.0.11</dotnetefVersion>
<MicrosoftEntityFrameworkCoreInMemoryVersion>7.0.11</MicrosoftEntityFrameworkCoreInMemoryVersion>
<MicrosoftEntityFrameworkCoreRelationalVersion>7.0.11</MicrosoftEntityFrameworkCoreRelationalVersion>
<MicrosoftEntityFrameworkCoreSqliteVersion>7.0.11</MicrosoftEntityFrameworkCoreSqliteVersion>
<MicrosoftEntityFrameworkCoreSqlServerVersion>7.0.11</MicrosoftEntityFrameworkCoreSqlServerVersion>
<MicrosoftEntityFrameworkCoreToolsVersion>7.0.11</MicrosoftEntityFrameworkCoreToolsVersion>
<MicrosoftEntityFrameworkCoreVersion>7.0.11</MicrosoftEntityFrameworkCoreVersion>
<MicrosoftEntityFrameworkCoreDesignVersion>7.0.11</MicrosoftEntityFrameworkCoreDesignVersion>
<dotnetefVersion>7.0.12</dotnetefVersion>
<MicrosoftEntityFrameworkCoreInMemoryVersion>7.0.12</MicrosoftEntityFrameworkCoreInMemoryVersion>
<MicrosoftEntityFrameworkCoreRelationalVersion>7.0.12</MicrosoftEntityFrameworkCoreRelationalVersion>
<MicrosoftEntityFrameworkCoreSqliteVersion>7.0.12</MicrosoftEntityFrameworkCoreSqliteVersion>
<MicrosoftEntityFrameworkCoreSqlServerVersion>7.0.12</MicrosoftEntityFrameworkCoreSqlServerVersion>
<MicrosoftEntityFrameworkCoreToolsVersion>7.0.12</MicrosoftEntityFrameworkCoreToolsVersion>
<MicrosoftEntityFrameworkCoreVersion>7.0.12</MicrosoftEntityFrameworkCoreVersion>
<MicrosoftEntityFrameworkCoreDesignVersion>7.0.12</MicrosoftEntityFrameworkCoreDesignVersion>
<!-- Packages from dotnet/arcade -->
<MicrosoftDotNetBuildTasksInstallersVersion>7.0.0-beta.23408.3</MicrosoftDotNetBuildTasksInstallersVersion>
<MicrosoftDotNetBuildTasksTemplatingVersion>7.0.0-beta.23408.3</MicrosoftDotNetBuildTasksTemplatingVersion>
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"sdk": {
"version": "7.0.111"
"version": "7.0.112"
},
"tools": {
"dotnet": "7.0.111",
"dotnet": "7.0.112",
"runtimes": {
"dotnet/x86": [
"$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"
Expand Down
67 changes: 61 additions & 6 deletions src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,31 @@ internal sealed partial class Http2Connection : IHttp2StreamLifetimeHandler, IHt
private const int MaxStreamPoolSize = 100;
private const long StreamPoolExpiryTicks = TimeSpan.TicksPerSecond * 5;

private const string MaximumEnhanceYourCalmCountProperty = "Microsoft.AspNetCore.Server.Kestrel.Http2.MaxEnhanceYourCalmCount";

private static readonly int _enhanceYourCalmMaximumCount = GetMaximumEnhanceYourCalmCount();

private static int GetMaximumEnhanceYourCalmCount()
{
var data = AppContext.GetData(MaximumEnhanceYourCalmCountProperty);
if (data is int count)
{
return count;
}
if (data is string countStr && int.TryParse(countStr, out var parsed))
{
return parsed;
}

return 20; // Empirically derived
}

// Accumulate _enhanceYourCalmCount over the course of EnhanceYourCalmTickWindowCount ticks.
// This should make bursts less likely to trigger disconnects.
private const int EnhanceYourCalmTickWindowCount = 5;

private static bool IsEnhanceYourCalmEnabled => _enhanceYourCalmMaximumCount > 0;

private readonly HttpConnectionContext _context;
private readonly Http2FrameWriter _frameWriter;
private readonly Pipe _input;
Expand Down Expand Up @@ -74,6 +99,9 @@ internal sealed partial class Http2Connection : IHttp2StreamLifetimeHandler, IHt
private int _clientActiveStreamCount;
private int _serverActiveStreamCount;

private int _enhanceYourCalmCount;
private int _tickCount;

// The following are the only fields that can be modified outside of the ProcessRequestsAsync loop.
private readonly ConcurrentQueue<Http2Stream> _completedStreams = new ConcurrentQueue<Http2Stream>();
private readonly StreamCloseAwaitable _streamCompletionAwaitable = new StreamCloseAwaitable();
Expand Down Expand Up @@ -361,13 +389,20 @@ public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> appl
stream.Abort(new IOException(CoreStrings.Http2StreamAborted, connectionError));
}

// Use the server _serverActiveStreamCount to drain all requests on the server side.
// Can't use _clientActiveStreamCount now as we now decrement that count earlier/
// Can't use _streams.Count as we wait for RST/END_STREAM before removing the stream from the dictionary
while (_serverActiveStreamCount > 0)
// For some reason, this loop doesn't terminate when we're trying to abort.
// Since we're making a narrow fix for a patch, we'll bypass it in such scenarios.
// TODO: This is probably a bug - something in here should probably detect aborted
// connections and short-circuit.
if (!IsEnhanceYourCalmEnabled || error is not Http2ConnectionErrorException)
{
await _streamCompletionAwaitable;
UpdateCompletedStreams();
// Use the server _serverActiveStreamCount to drain all requests on the server side.
// Can't use _clientActiveStreamCount now as we now decrement that count earlier/
// Can't use _streams.Count as we wait for RST/END_STREAM before removing the stream from the dictionary
while (_serverActiveStreamCount > 0)
{
await _streamCompletionAwaitable;
UpdateCompletedStreams();
}
}

while (StreamPool.TryPop(out var pooledStream))
Expand Down Expand Up @@ -1170,6 +1205,20 @@ private void StartStream()
// Server is getting hit hard with connection resets.
// Tell client to calm down.
// TODO consider making when to send ENHANCE_YOUR_CALM configurable?

if (IsEnhanceYourCalmEnabled && Interlocked.Increment(ref _enhanceYourCalmCount) > EnhanceYourCalmTickWindowCount * _enhanceYourCalmMaximumCount)
{
Log.Http2TooManyEnhanceYourCalms(_context.ConnectionId, _enhanceYourCalmMaximumCount);

// Now that we've logged a useful message, we can put vague text in the exception
// messages in case they somehow make it back to the client (not expected)

// This will close the socket - we want to do that right away
Abort(new ConnectionAbortedException(CoreStrings.Http2ConnectionFaulted));
// Throwing an exception as well will help us clean up on our end more quickly by (e.g.) skipping processing of already-buffered input
throw new Http2ConnectionErrorException(CoreStrings.Http2ConnectionFaulted, Http2ErrorCode.ENHANCE_YOUR_CALM);
}

throw new Http2StreamErrorException(_currentHeadersStream.StreamId, CoreStrings.Http2TellClientToCalmDown, Http2ErrorCode.ENHANCE_YOUR_CALM);
}
}
Expand Down Expand Up @@ -1241,6 +1290,12 @@ private void AbortStream(int streamId, IOException error)
void IRequestProcessor.Tick(DateTimeOffset now)
{
Input.CancelPendingRead();
// We count EYCs over a window of a given length to avoid flagging short-lived bursts.
// At the end of each window, reset the count.
if (IsEnhanceYourCalmEnabled && ++_tickCount % EnhanceYourCalmTickWindowCount == 0)
{
Interlocked.Exchange(ref _enhanceYourCalmCount, 0);
}
}

void IHttp2StreamLifetimeHandler.OnStreamCompleted(Http2Stream stream)
Expand Down
Loading
Loading