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

[NOREVIEW][NOMERGE] HTTP/3 stress data corruption hunt #101624

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions eng/docker/build-docker-sdk.ps1
Expand Up @@ -50,6 +50,8 @@ if ($buildWindowsContainers)
-Destination $dockerContext\microsoft.netcore.app.runtime.win-x64
Copy-Item -Recurse -Path $binArtifacts\testhost `
-Destination $dockerContext\testhost
Copy-Item -Recurse -Path $binArtifacts\System.IO.Pipelines/$configuration/net9.0/System.IO.Pipelines.dll `
-Destination $dockerContext
Copy-Item -Recurse -Path $REPO_ROOT_DIR\eng\targetingpacks.targets `
-Destination $dockerContext\targetingpacks.targets
Copy-Item -Recurse -Path $REPO_ROOT_DIR\src\libraries\System.Net.Quic\src\System\Net\Quic\Interop `
Expand Down
7 changes: 6 additions & 1 deletion eng/docker/libraries-sdk.linux.Dockerfile
Expand Up @@ -48,8 +48,13 @@ COPY --from=corefxbuild \
/repo/src/libraries/System.Net.Quic/src/System/Net/Quic/Interop \
/live-runtime-artifacts/msquic-interop

COPY --from=corefxbuild \
/repo/artifacts/bin/System.IO.Pipelines/$CONFIGURATION/net$VERSION/System.IO.Pipelines.dll \
/live-runtime-artifacts

# Add AspNetCore bits to testhost:
ENV _ASPNETCORE_SOURCE="/usr/share/dotnet/shared/Microsoft.AspNetCore.App/$VERSION*"
ENV _ASPNETCORE_DEST="/live-runtime-artifacts/testhost/net$VERSION-linux-$CONFIGURATION-x64/shared/Microsoft.AspNetCore.App"
RUN mkdir -p $_ASPNETCORE_DEST
RUN cp -r $_ASPNETCORE_SOURCE $_ASPNETCORE_DEST
RUN cp -r $_ASPNETCORE_SOURCE $_ASPNETCORE_DEST

111 changes: 91 additions & 20 deletions eng/pipelines/libraries/stress/http.yml
Expand Up @@ -70,22 +70,57 @@ extends:

- bash: |
cd '$(httpStressProject)'
export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/2.0"
export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/2.0"
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 2.0"
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 2.0"
export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/3.0"
export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/3.0"
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 3.0"
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 3.0"
docker-compose up --abort-on-container-exit --no-color
timeoutInMinutes: 35 # In case the HTTP/3.0 run hangs, we timeout shortly after the expected 30 minute run
displayName: Run HttpStress - HTTP 3.0
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- bash: |
cd '$(httpStressProject)'
export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/3.0"
export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/3.0"
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 3.0"
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 3.0"
docker-compose up --abort-on-container-exit --no-color
timeoutInMinutes: 35 # In case the HTTP/3.0 run hangs, we timeout shortly after the expected 30 minute run
displayName: Run HttpStress - HTTP 3.0
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- bash: |
cd '$(httpStressProject)'
export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/3.0"
export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/3.0"
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 3.0"
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 3.0"
docker-compose up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 2.0
timeoutInMinutes: 35 # In case the HTTP/3.0 run hangs, we timeout shortly after the expected 30 minute run
displayName: Run HttpStress - HTTP 3.0
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- bash: |
cd '$(httpStressProject)'
export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/1.1"
export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/1.1"
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 1.1"
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 1.1"
export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/3.0"
export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/3.0"
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 3.0"
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 3.0"
docker-compose up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 1.1
timeoutInMinutes: 35 # In case the HTTP/3.0 run hangs, we timeout shortly after the expected 30 minute run
displayName: Run HttpStress - HTTP 3.0
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- bash: |
cd '$(httpStressProject)'
export CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/3.0"
export SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/3.0"
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 3.0"
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 3.0"
docker-compose up --abort-on-container-exit --no-color
timeoutInMinutes: 35 # In case the HTTP/3.0 run hangs, we timeout shortly after the expected 30 minute run
displayName: Run HttpStress - HTTP 3.0
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- bash: |
Expand Down Expand Up @@ -154,26 +189,62 @@ extends:

- powershell: |
cd '$(httpStressProject)'
$env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/2.0"
$env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/2.0"
$env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/3.0"
$env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/3.0"
New-Item -Force $env:CLIENT_DUMPS_SHARE -ItemType Directory
New-Item -Force $env:SERVER_DUMPS_SHARE -ItemType Directory
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 2.0"
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 2.0"
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 3.0"
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 3.0"
& $env:DOCKER_COMPOSE_CMD up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 2.0
displayName: Run HttpStress - HTTP 3.0
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- powershell: |
cd '$(httpStressProject)'
$env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/1.1"
$env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/1.1"
$env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/3.0"
$env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/3.0"
New-Item -Force $env:CLIENT_DUMPS_SHARE -ItemType Directory
New-Item -Force $env:SERVER_DUMPS_SHARE -ItemType Directory
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 1.1"
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 1.1"
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 3.0"
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 3.0"
& $env:DOCKER_COMPOSE_CMD up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 1.1
displayName: Run HttpStress - HTTP 3.0
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- powershell: |
cd '$(httpStressProject)'
$env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/3.0"
$env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/3.0"
New-Item -Force $env:CLIENT_DUMPS_SHARE -ItemType Directory
New-Item -Force $env:SERVER_DUMPS_SHARE -ItemType Directory
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 3.0"
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 3.0"
& $env:DOCKER_COMPOSE_CMD up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 3.0
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- powershell: |
cd '$(httpStressProject)'
$env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/3.0"
$env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/3.0"
New-Item -Force $env:CLIENT_DUMPS_SHARE -ItemType Directory
New-Item -Force $env:SERVER_DUMPS_SHARE -ItemType Directory
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 3.0"
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 3.0"
& $env:DOCKER_COMPOSE_CMD up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 3.0
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- powershell: |
cd '$(httpStressProject)'
$env:CLIENT_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/client/3.0"
$env:SERVER_DUMPS_SHARE="$(Build.ArtifactStagingDirectory)/dumps/server/3.0"
New-Item -Force $env:CLIENT_DUMPS_SHARE -ItemType Directory
New-Item -Force $env:SERVER_DUMPS_SHARE -ItemType Directory
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 3.0"
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 3.0"
& $env:DOCKER_COMPOSE_CMD up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 3.0
condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))

- publish: $(Build.ArtifactStagingDirectory)/dumps
Expand Down
20 changes: 10 additions & 10 deletions src/libraries/Common/src/System/Net/ArrayBuffer.cs
Expand Up @@ -31,7 +31,7 @@ internal struct ArrayBuffer : IDisposable

public ArrayBuffer(int initialSize, bool usePool = false)
{
Debug.Assert(initialSize > 0 || usePool);
// Debug.Assert(initialSize > 0 || usePool);

_usePool = usePool;
_bytes = initialSize == 0
Expand All @@ -43,7 +43,7 @@ public ArrayBuffer(int initialSize, bool usePool = false)

public ArrayBuffer(byte[] buffer)
{
Debug.Assert(buffer.Length > 0);
// Debug.Assert(buffer.Length > 0);

_usePool = false;
_bytes = buffer;
Expand All @@ -68,8 +68,8 @@ public void Dispose()
// This is different from Dispose as the instance remains usable afterwards (_bytes will not be null).
public void ClearAndReturnBuffer()
{
Debug.Assert(_usePool);
Debug.Assert(_bytes is not null);
// Debug.Assert(_usePool);
// Debug.Assert(_bytes is not null);

_activeStart = 0;
_availableStart = 0;
Expand All @@ -96,7 +96,7 @@ public void ClearAndReturnBuffer()

public void Discard(int byteCount)
{
Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}");
// Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}");
_activeStart += byteCount;

if (_activeStart == _availableStart)
Expand All @@ -108,7 +108,7 @@ public void Discard(int byteCount)

public void Commit(int byteCount)
{
Debug.Assert(byteCount <= AvailableLength);
// Debug.Assert(byteCount <= AvailableLength);
_availableStart += byteCount;
}

Expand All @@ -124,11 +124,11 @@ public void EnsureAvailableSpace(int byteCount)

private void EnsureAvailableSpaceCore(int byteCount)
{
Debug.Assert(AvailableLength < byteCount);
// Debug.Assert(AvailableLength < byteCount);

if (_bytes.Length == 0)
{
Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0);
// Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0);
_bytes = ArrayPool<byte>.Shared.Rent(byteCount);
return;
}
Expand All @@ -140,7 +140,7 @@ private void EnsureAvailableSpaceCore(int byteCount)
Buffer.BlockCopy(_bytes, _activeStart, _bytes, 0, ActiveLength);
_availableStart = ActiveLength;
_activeStart = 0;
Debug.Assert(byteCount <= AvailableLength);
// Debug.Assert(byteCount <= AvailableLength);
return;
}

Expand Down Expand Up @@ -168,7 +168,7 @@ private void EnsureAvailableSpaceCore(int byteCount)
_bytes = newBytes;
ReturnBufferIfPooled(oldBytes);

Debug.Assert(byteCount <= AvailableLength);
// Debug.Assert(byteCount <= AvailableLength);
}

public void Grow()
Expand Down
Expand Up @@ -43,8 +43,12 @@ System.IO.Pipelines.PipeReader</PackageDescription>
<Compile Include="System\IO\Pipelines\StreamPipeWriter.cs" />
<Compile Include="System\IO\Pipelines\StreamPipeWriterOptions.cs" />
<Compile Include="System\IO\Pipelines\ThrowHelper.cs" />
<Compile Include="$(CommonPath)System\Net\ArrayBuffer.cs" Link="Common\System\Net\ArrayBuffer.cs" />
<Compile Include="$(CommonPath)System\IO\StreamHelpers.CopyValidation.cs"
Link="Common\System\IO\StreamHelpers.CopyValidation.cs" />
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs</Link>
</Compile>
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
Expand Down
@@ -1,3 +1,4 @@
#define DEBUG
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

Expand Down