diff options
author | 2017-11-16 14:57:30 -0800 | |
---|---|---|
committer | 2017-11-16 14:57:30 -0800 | |
commit | 6d6636987bb36e35fe0197a1ed578d22f3ffde59 (patch) | |
tree | 5249a77d27e45bbdc82bf7ed2ee93c97bacb6186 /src/core/ext/transport | |
parent | ad3bdbeb4a2e9d411b07f4bc008a5b2f8274be40 (diff) | |
parent | 1028787b5a87440f9f46c5b402166bc10b59b7f8 (diff) |
Merge pull request #13388 from y-zeng/flow_control
Flow control fixes
Diffstat (limited to 'src/core/ext/transport')
-rw-r--r-- | src/core/ext/transport/chttp2/transport/flow_control.cc | 4 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/transport/writing.cc | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/core/ext/transport/chttp2/transport/flow_control.cc b/src/core/ext/transport/chttp2/transport/flow_control.cc index 64f6b3c917..b4e3118043 100644 --- a/src/core/ext/transport/chttp2/transport/flow_control.cc +++ b/src/core/ext/transport/chttp2/transport/flow_control.cc @@ -312,7 +312,9 @@ double TransportFlowControl::SmoothLogBdp(grpc_exec_ctx* exec_ctx, double bdp_error = value - pid_controller_.last_control_value(); const double dt = (double)(now - last_pid_update_) * 1e-3; last_pid_update_ = now; - return pid_controller_.Update(bdp_error, dt); + // Limit dt to 100ms + const double kMaxDt = 0.1; + return pid_controller_.Update(bdp_error, dt > kMaxDt ? kMaxDt : dt); } FlowControlAction::Urgency TransportFlowControl::DeltaUrgency( diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc index 61a2598618..c36b4bd828 100644 --- a/src/core/ext/transport/chttp2/transport/writing.cc +++ b/src/core/ext/transport/chttp2/transport/writing.cc @@ -322,7 +322,7 @@ class DataSendContext { GPR_MIN(stream_remote_window(), t_->flow_control->remote_window())); } - bool AnyOutgoing() const { return max_outgoing() != 0; } + bool AnyOutgoing() const { return max_outgoing() > 0; } void FlushCompressedBytes() { uint32_t send_bytes = |