From 095a220acb68365a39a7c711d6d244827d080d08 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 17 May 2017 09:02:44 -0700 Subject: Stop setting deadline on server requests, assert so that this never happens again --- src/core/ext/transport/chttp2/transport/chttp2_transport.c | 13 +++++++++++++ src/core/lib/surface/call.c | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index fb8ceaecb0..c70efec217 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -1492,6 +1492,19 @@ static void perform_stream_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt, grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt; grpc_chttp2_stream *s = (grpc_chttp2_stream *)gs; + if (!t->is_client) { + if (op->send_initial_metadata) { + GPR_ASSERT(0 == gpr_time_cmp(gpr_inf_future(GPR_CLOCK_MONOTONIC), + op->payload->send_initial_metadata + .send_initial_metadata->deadline)); + } + if (op->send_trailing_metadata) { + GPR_ASSERT(0 == gpr_time_cmp(gpr_inf_future(GPR_CLOCK_MONOTONIC), + op->payload->send_trailing_metadata + .send_trailing_metadata->deadline)); + } + } + if (GRPC_TRACER_ON(grpc_http_trace)) { char *str = grpc_transport_stream_op_batch_string(op); gpr_log(GPR_DEBUG, "perform_stream_op[s=%p]: %s", s, str); diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index 201969cd45..4e220bb467 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -1531,7 +1531,9 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, goto done_with_error; } /* TODO(ctiller): just make these the same variable? */ - call->metadata_batch[0][0].deadline = call->send_deadline; + if (call->is_client) { + call->metadata_batch[0][0].deadline = call->send_deadline; + } stream_op_payload->send_initial_metadata.send_initial_metadata = &call->metadata_batch[0 /* is_receiving */][0 /* is_trailing */]; stream_op_payload->send_initial_metadata.send_initial_metadata_flags = -- cgit v1.2.3 From 7ffb7232be38c2c5abe1059fe84d7a2f8d98e133 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 17 May 2017 12:52:10 -0700 Subject: Fix comparison --- src/core/ext/transport/chttp2/transport/chttp2_transport.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/core') diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index c70efec217..fe9e88b84e 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -1494,14 +1494,16 @@ static void perform_stream_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt, if (!t->is_client) { if (op->send_initial_metadata) { - GPR_ASSERT(0 == gpr_time_cmp(gpr_inf_future(GPR_CLOCK_MONOTONIC), - op->payload->send_initial_metadata - .send_initial_metadata->deadline)); + gpr_timespec deadline = + op->payload->send_initial_metadata.send_initial_metadata->deadline; + GPR_ASSERT(0 == + gpr_time_cmp(gpr_inf_future(deadline.clock_type), deadline)); } if (op->send_trailing_metadata) { - GPR_ASSERT(0 == gpr_time_cmp(gpr_inf_future(GPR_CLOCK_MONOTONIC), - op->payload->send_trailing_metadata - .send_trailing_metadata->deadline)); + gpr_timespec deadline = + op->payload->send_trailing_metadata.send_trailing_metadata->deadline; + GPR_ASSERT(0 == + gpr_time_cmp(gpr_inf_future(deadline.clock_type), deadline)); } } -- cgit v1.2.3