From 81f92c855da78c0221f1190200690895f516b845 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 19 Apr 2017 12:43:24 -0700 Subject: [PATCH] Tighten BDP increase conditions, better fix target transport window sizing --- src/core/ext/transport/chttp2/transport/writing.c | 7 ++----- src/core/lib/transport/bdp_estimator.c | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/core/ext/transport/chttp2/transport/writing.c b/src/core/ext/transport/chttp2/transport/writing.c index 87a83ef3b35..9267544a5cf 100644 --- a/src/core/ext/transport/chttp2/transport/writing.c +++ b/src/core/ext/transport/chttp2/transport/writing.c @@ -164,11 +164,8 @@ uint32_t grpc_chttp2_target_incoming_window(grpc_chttp2_transport *t) { return (uint32_t)GPR_MIN( (int64_t)((1u << 31) - 1), t->stream_total_over_incoming_window + - (int64_t)GPR_MAX( - t->settings[GRPC_SENT_SETTINGS] - [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE] - - t->stream_total_under_incoming_window, - 0)); + t->settings[GRPC_SENT_SETTINGS] + [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE]); } bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, diff --git a/src/core/lib/transport/bdp_estimator.c b/src/core/lib/transport/bdp_estimator.c index 7dd5db022f0..9eecf7d4153 100644 --- a/src/core/lib/transport/bdp_estimator.c +++ b/src/core/lib/transport/bdp_estimator.c @@ -100,7 +100,7 @@ void grpc_bdp_estimator_complete_ping(grpc_bdp_estimator *estimator) { bw / 125000.0, estimator->bw_est / 125000.0); } GPR_ASSERT(estimator->ping_state == GRPC_BDP_PING_STARTED); - if (estimator->accumulator > 2 * estimator->estimate / 3 && + if (estimator->accumulator > 7 * estimator->estimate / 8 && bw > estimator->bw_est) { estimator->estimate *= 2; estimator->bw_est = bw;