-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[HTTP/3] Stress hack for msquic dropping connections #84793
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
Merged
ManickaP
merged 13 commits into
dotnet:main
from
ManickaP:mapichov/h3-stress-msquic-hack
Apr 28, 2023
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
df45d59
Implement the same hack as for functional tests to prevent msquic fro…
ManickaP df7b541
Feedback: removed code sharing and used reflaction
ManickaP bd6c04d
Try to fix missing build dependency
ManickaP fa5820e
Feedback - removed test only function and replaced with shared code +…
ManickaP b649716
Merge branch 'main' into mapichov/h3-stress-msquic-hack
antonfirsov ed73b02
fix argument handling in build-local.ps1
antonfirsov 7e4d512
do not use MsQuicLibraryVersion
antonfirsov 1f8f56e
copy msquic interop utils to the SDK base image
antonfirsov d2c113c
use LinkBase in Functional.Tests.csproj for wildcard include
antonfirsov 7613f06
Merge branch 'main' into mapichov/h3-stress-msquic-hack
antonfirsov 0a9731f
Use MsQuicLibraryVersion in out internal logging and as a side-effect…
ManickaP e316a13
Comment
ManickaP 949d82b
also copy files to the Linux container
antonfirsov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/libraries/System.Net.Http/tests/StressTests/HttpStress/System.Net.Quic.Stub.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using static Microsoft.Quic.MsQuic; | ||
|
|
||
| namespace System.Net.Quic; | ||
|
|
||
| internal static class ThrowHelper | ||
| { | ||
| internal static Exception GetExceptionForMsQuicStatus(int status, string? message = null) | ||
| => new QuicException(QuicError.InternalError, null, $"{message} (0x{status:x})"); | ||
|
|
||
| internal static void ThrowIfMsQuicError(int status, string? message = null) | ||
| { | ||
| if (StatusFailed(status)) | ||
| { | ||
| throw GetExceptionForMsQuicStatus(status, message); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| internal static partial class Interop | ||
| { | ||
| internal static partial class Libraries | ||
| { | ||
| #if WINDOWS | ||
| internal const string MsQuic = "msquic.dll"; | ||
| #elif OSX | ||
| internal const string MsQuic = "libmsquic.dylib"; | ||
| #else | ||
| internal const string MsQuic = "libmsquic.so"; | ||
| #endif | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A refactor of these internals may break stress builds without us noticing,
but I guess there is no good way to deal with this. We should remember thatHttpStresstook a dependency.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also: these files are missing from the docker context on Windows, which is why the Windows build failed. Copying them would make this solution even more fragile. Can we implement the worker delay tuning hack with reflection instead and share that implementation between
System.Net.Quic.Functional.Testsand the stress tests to make sure we notice if it's broken? That would also remove the need of including anything butQuicDefaults.csinSystem.Net.Quic.Functional.Tests.csproj(apart from the utility containing the hack).Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah no, we would need #75347 to invoke function pointers with reflection safely. I guess, the best would be to copy & include
msquic_generated.cs, then do a combination of reflection + code that only depends on the generated types.I can take over if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reflection was one of the options we discussed with @CarnaViire when implementing this in functional tests. I was able to workaround it in functional tests with source code inclusion, which is normal for corresponding tests. However, here it proves problematic.
I could re-work this to create an internal function on
MsQuicApiwhich we would invoke via reflection from both functional tests as well as stress.