@@ -115,11 +115,14 @@ public DynamicFlowControlSettings build() {
115115 }
116116
117117 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 ) {
123126 return ;
124127 }
125128 Preconditions .checkState (
@@ -141,11 +144,14 @@ private void verifyElementCountSettings(DynamicFlowControlSettings settings) {
141144 }
142145
143146 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 ) {
149155 return ;
150156 }
151157 Preconditions .checkState (
0 commit comments