Skip to content

React to pipe renames #162

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
merged 1 commit into from
Mar 18, 2019
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
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "3.0.100-preview3-010431"
"version": "3.0.100-preview4-010737"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a nightly release? if merged as is, bumping would break the continuous interop test build.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should figure out how to do testing against the latest released preview and against the nightly build at the same time.
Should we have two builds - one against the latest nightly and one against the latest released preview and test against both (and use #ifdefs to make things buildable). Then, once the next preview is out, we can cleanup the #ifdef sites?

Btw, would that nightly have dotnet/aspnetcore#8200?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is a nightly release.

What is the value of testing a build with custom #ifdefs against the official preview? Is it to keep the interop test build passing because it is not possible to install nightly .NET SDKs in that environment?

Copy link
Contributor

@jtattermusch jtattermusch Mar 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the main value is maintain the ability to do a release on nuget.org at any time (there's probably no point in releasing something that won't work with the latest official preview) and early adopters still being able to build against the latest preview.

In the interop framework we could pull the never version of SDK if needed, but we'd like to avoid if possible because none of the other gRPC languages does that - all use a fixed environment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, updating the dotnet SDK version in out performance benchmark harness is harder than updating for interop framework - which is yet another motivation to keep things buildable with the stable preview.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we need to make a point release I think it should come from a branch from the 0.1.9 release. I'd rather not try to maintain two versions because we're going to have more and more minor breaking changes from the SDK:

I don't think we should automatically use the latest nightly each build, but we are going to need to manually update to a newer nightly from time to time. This isn't really any different from manually updating to a newer official preview SDK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating should be as simple as running the build/get-dotnet.{ps1/sh} script.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ protected override async Task HandleCallAsyncCore(HttpContext httpContext)
throw new RpcException(new Status(StatusCode.Cancelled, "No message returned from method."));
}

var responseBodyPipe = httpContext.Response.BodyPipe;
await responseBodyPipe.WriteMessageAsync(response, serverCallContext, Method.ResponseMarshaller.Serializer);
var responseBodyWriter = httpContext.Response.BodyWriter;
await responseBodyWriter.WriteMessageAsync(response, serverCallContext, Method.ResponseMarshaller.Serializer);
}
catch (Exception ex)
{
Expand All @@ -87,7 +87,7 @@ protected override async Task HandleCallAsyncCore(HttpContext httpContext)
httpContext.Response.ConsolidateTrailers(serverCallContext);

// Flush any buffered content
await httpContext.Response.BodyPipe.FlushAsync();
await httpContext.Response.BodyWriter.FlushAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ await _invoker(
httpContext.Response.ConsolidateTrailers(serverCallContext);

// Flush any buffered content
await httpContext.Response.BodyPipe.FlushAsync();
await httpContext.Response.BodyWriter.FlushAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected override async Task HandleCallAsyncCore(HttpContext httpContext)
serverCallContext.Initialize();

// Decode request
var requestPayload = await httpContext.Request.BodyPipe.ReadSingleMessageAsync(serverCallContext);
var requestPayload = await httpContext.Request.BodyReader.ReadSingleMessageAsync(serverCallContext);
var request = Method.RequestMarshaller.Deserializer(requestPayload);

service = activator.Create();
Expand All @@ -78,7 +78,7 @@ await _invoker(
httpContext.Response.ConsolidateTrailers(serverCallContext);

// Flush any buffered content
await httpContext.Response.BodyPipe.FlushAsync();
await httpContext.Response.BodyWriter.FlushAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected override async Task HandleCallAsyncCore(HttpContext httpContext)
{
serverCallContext.Initialize();

var requestPayload = await httpContext.Request.BodyPipe.ReadSingleMessageAsync(serverCallContext);
var requestPayload = await httpContext.Request.BodyReader.ReadSingleMessageAsync(serverCallContext);

var request = Method.RequestMarshaller.Deserializer(requestPayload);

Expand All @@ -69,8 +69,8 @@ protected override async Task HandleCallAsyncCore(HttpContext httpContext)
throw new RpcException(new Status(StatusCode.Cancelled, "No message returned from method."));
}

var responseBodyPipe = httpContext.Response.BodyPipe;
await responseBodyPipe.WriteMessageAsync(response, serverCallContext, Method.ResponseMarshaller.Serializer);
var responseBodyWriter = httpContext.Response.BodyWriter;
await responseBodyWriter.WriteMessageAsync(response, serverCallContext, Method.ResponseMarshaller.Serializer);
}
catch (Exception ex)
{
Expand All @@ -88,7 +88,7 @@ protected override async Task HandleCallAsyncCore(HttpContext httpContext)
httpContext.Response.ConsolidateTrailers(serverCallContext);

// Flush any buffered content
await httpContext.Response.BodyPipe.FlushAsync();
await httpContext.Response.BodyWriter.FlushAsync();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async Task<bool> MoveNextAsync(ValueTask<byte[]> readStreamTask)
return Task.FromCanceled<bool>(cancellationToken);
}

var readStreamTask = _serverCallContext.HttpContext.Request.BodyPipe.ReadStreamMessageAsync(_serverCallContext, cancellationToken);
var readStreamTask = _serverCallContext.HttpContext.Request.BodyReader.ReadStreamMessageAsync(_serverCallContext, cancellationToken);
if (!readStreamTask.IsCompletedSuccessfully)
{
return MoveNextAsync(readStreamTask);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Task WriteAsync(TResponse message)
throw new InvalidOperationException("Cannot write message after request is complete.");
}

return _context.HttpContext.Response.BodyPipe.WriteMessageAsync(message, _context, _serializer);
return _context.HttpContext.Response.BodyWriter.WriteMessageAsync(message, _context, _serializer);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public async Task MoveNext_TokenCancelledDuringMoveNext_CancelTask()
var ms = new SyncPointMemoryStream();

var httpContext = new DefaultHttpContext();
httpContext.Request.BodyPipe = new StreamPipeReader(ms);
httpContext.Request.BodyReader = new StreamPipeReader(ms);
var serverCallContext = HttpContextServerCallContextHelper.CreateServerCallContext(httpContext);
var reader = new HttpContextStreamReader<HelloReply>(serverCallContext, (data) =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async Task WriteAsync_DefaultWriteOptions_Flushes()
var ms = new MemoryStream();

var httpContext = new DefaultHttpContext();
httpContext.Response.BodyPipe = new StreamPipeWriter(ms);
httpContext.Response.BodyWriter = new StreamPipeWriter(ms);
var serverCallContext = HttpContextServerCallContextHelper.CreateServerCallContext(httpContext);
var writer = new HttpContextStreamWriter<HelloReply>(serverCallContext, (message) => message.ToByteArray());

Expand Down Expand Up @@ -77,7 +77,7 @@ public async Task WriteAsync_BufferHintWriteOptions_DoesNotFlush()
var ms = new MemoryStream();

var httpContext = new DefaultHttpContext();
httpContext.Response.BodyPipe = new StreamPipeWriter(ms);
httpContext.Response.BodyWriter = new StreamPipeWriter(ms);
var serverCallContext = HttpContextServerCallContextHelper.CreateServerCallContext(httpContext);
var writer = new HttpContextStreamWriter<HelloReply>(serverCallContext, (message) => message.ToByteArray());
serverCallContext.WriteOptions = new WriteOptions(WriteFlags.BufferHint);
Expand All @@ -100,7 +100,7 @@ await writer.WriteAsync(new HelloReply
// Assert 2
Assert.AreEqual(0, ms.Length);

await httpContext.Response.BodyPipe.FlushAsync();
await httpContext.Response.BodyWriter.FlushAsync();

ms.Seek(0, SeekOrigin.Begin);
var pipeReader = new StreamPipeReader(ms);
Expand Down