Copilot commented on code in PR #13386:
URL: https://github.com/apache/trafficserver/pull/13386#discussion_r3587965320


##########
tests/gold_tests/h2/clients/h2_max_active_streams.py:
##########
@@ -0,0 +1,173 @@
+#!/usr/bin/env python3
+'''
+HTTP/2 client that opens N concurrent streams to test the global
+active-streams cap and the HPACK dynamic-table sync across refused streams.
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.

Review Comment:
   The Apache license header should appear immediately after the shebang (and 
before the module docstring), consistent with other gold test client scripts 
(e.g. tests/gold_tests/tls/h2_early_decode.py).



##########
src/proxy/http2/Http2ConnectionState.cc:
##########
@@ -2883,6 +2905,12 @@ Http2ConnectionState::_adjust_concurrent_stream()
     return max_concurrent_streams;
   }
 
+  if (!this->session->is_outbound() && Http2::max_active_streams_policy_in == 
1) {
+    // Under hard-enforcement the advertised value is left untouched; new 
streams
+    // are refused at creation instead of throttling down concurrency.
+    return max_concurrent_streams;
+  }

Review Comment:
   The function header comment above this new early-return is now inaccurate: 
under max_active_streams_policy_in==1 (hard-enforce), 
_adjust_concurrent_stream() no longer “returns min_concurrent_streams_in when … 
larger than max_active_streams_in”. Please update the comment to reflect that 
throttling is advisory-only (policy 0).



##########
tests/gold_tests/h2/http2_max_active_streams.test.py:
##########
@@ -0,0 +1,86 @@
+'''
+Verify proxy.config.http2.max_active_streams_policy_in enforces the global
+active-streams cap and that HPACK stays in sync across refused streams.
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.

Review Comment:
   New gold test scripts typically place the Apache license header at the top 
of the file (see other tests/gold_tests/h2/*.test.py). Please move this module 
docstring below the license header so the license remains the first non-shebang 
content.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to