Merge pull request #21532 from vjpai/deadline

Properly set up deadline for generic callback requests
pull/21538/head
Vijay Pai 5 years ago committed by GitHub
commit 027eb3b05b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/cpp/server/server_cc.cc
  2. 2
      test/cpp/end2end/hybrid_end2end_test.cc

@ -818,6 +818,7 @@ bool Server::CallbackRequest<
grpc::GenericCallbackServerContext>::FinalizeResult(void** /*tag*/,
bool* status) {
if (*status) {
deadline_ = call_details_->deadline;
// TODO(yangg) remove the copy here
ctx_.method_ = grpc::StringFromCopiedSlice(call_details_->method);
ctx_.host_ = grpc::StringFromCopiedSlice(call_details_->host);

@ -821,6 +821,8 @@ TEST_P(HybridEnd2endTest, CallbackGenericEcho) {
ServerGenericBidiReactor* CreateReactor(
GenericCallbackServerContext* context) override {
EXPECT_EQ(context->method(), "/grpc.testing.EchoTestService/Echo");
gpr_log(GPR_DEBUG, "Constructor of generic service %d",
static_cast<int>(context->deadline().time_since_epoch().count()));
class Reactor : public ServerGenericBidiReactor {
public:

Loading…
Cancel
Save