-
Notifications
You must be signed in to change notification settings - Fork 776
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
Disable min request data rate for client streaming calls #259
Conversation
@@ -13,7 +13,7 @@ | |||
|
|||
<!-- static local methods are a C# 8.0 feature --> | |||
<LangVersion>preview</LangVersion> | |||
<NullableContextOptions>enable</NullableContextOptions> | |||
<Nullable>enable</Nullable> |
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.
Reacting to dotnet/roslyn#35516.
@@ -171,7 +171,7 @@ private static bool TryReadHeader(in ReadOnlySequence<byte> buffer, out bool com | |||
} | |||
else | |||
{ | |||
Span<byte> headerData = stackalloc byte[HeaderSize]; | |||
Span<byte> headerData = new byte[HeaderSize]; |
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.
Yikes dotnet/roslyn#35764. A broken Roslyn shouldn't make its way into our SDK build though, need to figure out why we are getting a bad compiler.
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.
The PR for the fix is already approved. Could just wait for the fix before this change goes in. and revert this workaround.
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.
This isn't blocking anything. Lets wait until the SDK is fixed.
@@ -62,7 +62,7 @@ private static async Task ClientStreamingCallExample(Counter.CounterClient clien | |||
var count = RNG.Next(5); | |||
Console.WriteLine($"Accumulating with {count}"); | |||
await call.RequestStream.WriteAsync(new CounterRequest { Count = count }); | |||
await Task.Delay(1000); | |||
await Task.Delay(2000); |
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.
Setting to 2s to trigger request data rate limit.
src/Grpc.AspNetCore.Server/Internal/CallHandlers/ClientStreamingServerCallHandler.cs
Outdated
Show resolved
Hide resolved
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.
Need unit tests
src/Grpc.AspNetCore.Server/Internal/CallHandlers/ClientStreamingServerCallHandler.cs
Outdated
Show resolved
Hide resolved
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.
Repeat for each test
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.
LGTM.
I'm going to merge this because the Roslyn bug is still broken in the latest SDK. |
Addresses #15