@@ -115,11 +115,14 @@ public DynamicFlowControlSettings build() {
115
115
}
116
116
117
117
private void verifyElementCountSettings (DynamicFlowControlSettings settings ) {
118
- boolean isEnabled =
119
- settings .getInitialOutstandingElementCount () != null
120
- || settings .getMinOutstandingElementCount () != null
121
- || settings .getMaxOutstandingElementCount () != null ;
122
- if (!isEnabled ) {
118
+ // If LimitExceededBehavior is Ignore, dynamic flow control is disabled, there's no need to
119
+ // check element count limit settings
120
+ if (settings .getLimitExceededBehavior () == LimitExceededBehavior .Ignore ) {
121
+ return ;
122
+ }
123
+ if (settings .getInitialOutstandingElementCount () == null
124
+ && settings .getMinOutstandingElementCount () == null
125
+ && settings .getMaxOutstandingElementCount () == null ) {
123
126
return ;
124
127
}
125
128
Preconditions .checkState (
@@ -141,11 +144,14 @@ private void verifyElementCountSettings(DynamicFlowControlSettings settings) {
141
144
}
142
145
143
146
private void verifyRequestBytesSettings (DynamicFlowControlSettings settings ) {
144
- boolean isEnabled =
145
- settings .getInitialOutstandingRequestBytes () != null
146
- || settings .getMinOutstandingRequestBytes () != null
147
- || settings .getMaxOutstandingRequestBytes () != null ;
148
- if (!isEnabled ) {
147
+ // If LimitExceededBehavior is Ignore, dynamic flow control is disabled, there's no need to
148
+ // check request bytes limit settings
149
+ if (settings .getLimitExceededBehavior () == LimitExceededBehavior .Ignore ) {
150
+ return ;
151
+ }
152
+ if (settings .getInitialOutstandingRequestBytes () == null
153
+ && settings .getMinOutstandingRequestBytes () == null
154
+ && settings .getMaxOutstandingRequestBytes () == null ) {
149
155
return ;
150
156
}
151
157
Preconditions .checkState (
0 commit comments