diff options
author | Craig Tiller <ctiller@google.com> | 2017-04-18 17:02:58 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-04-18 17:02:58 -0700 |
commit | 8b0db7f17cb3d759c7665f14f5bdfc44e0a9d683 (patch) | |
tree | 05aba0c4285c6d4272d236d6354f465c82ec2bac | |
parent | 40fde140f45d1af4d12f7f6d150ec0b5ec41cc30 (diff) |
Refine flow control update rules: drastic improvement in trickle failure rates
-rw-r--r-- | src/core/ext/transport/chttp2/transport/chttp2_transport.c | 2 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/transport/parsing.c | 7 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 5c5175f566..1daca437b2 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -2542,7 +2542,7 @@ static void incoming_byte_stream_update_flow_control(grpc_exec_ctx *exec_ctx, add_max_recv_bytes); if ((int64_t)s->incoming_window_delta + (int64_t)initial_window_size - (int64_t)s->announce_window > - (int64_t)initial_window_size / 2) { + 2 * (int64_t)initial_window_size) { write_type = GRPC_CHTTP2_STREAM_WRITE_PIGGYBACK; } grpc_chttp2_become_writable(exec_ctx, t, s, write_type, diff --git a/src/core/ext/transport/chttp2/transport/parsing.c b/src/core/ext/transport/chttp2/transport/parsing.c index 638b137316..d0b94bd6ce 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.c +++ b/src/core/ext/transport/chttp2/transport/parsing.c @@ -418,12 +418,7 @@ static grpc_error *update_incoming_window(grpc_exec_ctx *exec_ctx, GRPC_CHTTP2_FLOW_DEBIT_STREAM_INCOMING_WINDOW_DELTA("parse", t, s, incoming_frame_size); - if ((int64_t)t->settings[GRPC_SENT_SETTINGS] - [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE] + - (int64_t)s->incoming_window_delta - (int64_t)s->announce_window <= - (int64_t)t->settings[GRPC_SENT_SETTINGS] - [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE] / - 2) { + if ((int64_t)s->incoming_window_delta - (int64_t)s->announce_window <= 0) { grpc_chttp2_become_writable(exec_ctx, t, s, GRPC_CHTTP2_STREAM_WRITE_INITIATE_UNCOVERED, "window-update-required"); |