bneradt commented on code in PR #13447:
URL: https://github.com/apache/trafficserver/pull/13447#discussion_r4157066112


##########
src/proxy/http/HttpSM.cc:
##########
@@ -6362,7 +6401,7 @@ HttpSM::handle_post_failure()
   // Server is down
   if (t_state.current.state == HttpTransact::STATE_UNDEFINED || 
t_state.current.state == HttpTransact::CONNECTION_ALIVE) {
     t_state.set_connect_fail(server_txn->get_netvc()->lerrno);
-    t_state.current.state = HttpTransact::CONNECTION_CLOSED;
+    t_state.current.state = retry ? HttpTransact::CONNECTION_ERROR : 
HttpTransact::CONNECTION_CLOSED;

Review Comment:
   Fixed: handle_post_failure now also converts CONNECTION_CLOSED to 
CONNECTION_ERROR when prepare_for_origin_retry admitted the retry. Timeout and 
other pre-existing failure states remain unchanged, and the 
complete-body/peer-not-processed gates still apply. Build and all 15 existing 
retry scenarios pass. I did not add a new end-to-end test specifically 
isolating this guard: candidate upload tests reached incomplete-body rejection 
or the response-error path instead.



##########
tests/gold_tests/h2/h2_to_origin_continuation.test.py:
##########
@@ -0,0 +1,122 @@
+'''
+Verify that ATS does not tear down outbound HTTP/2 connections, and does
+not crash on a `_sm == nullptr` assertion, when the origin response
+headers may be split across HEADERS + CONTINUATION frames on a stream
+that has already advanced past IDLE.
+'''
+#  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.
+
+import os
+import sys
+
+from ports import get_port
+
+Test.Summary = '''
+Verify that ATS does not tear down outbound HTTP/2 connections and does
+not crash on a `_sm == nullptr` assertion when receiving the origin's
+response on a stream that is past the IDLE state.
+'''
+
+Test.ContinueOnFail = True
+
+replay_file = "replay_h2o_continuation/continuation.replay.yaml"
+
+tr = Test.AddTestRun("Outbound HTTP/2 CONTINUATION on a non-IDLE stream")
+tr.Setup.Copy("continuation_origin.py")
+tr.Setup.Copy("origin_lifecycle.py")
+stop_file = f"{tr.RunDirectory}/stop-origin"
+lifecycle_script = f"{tr.RunDirectory}/origin_lifecycle.py"
+
+server = Test.Processes.Process("h2-continuation-origin")
+server_port = get_port(server, "https_port")
+server_pem = os.path.join(Test.Variables.AtsTestToolsDir, "ssl", "server.pem")
+server_key = os.path.join(Test.Variables.AtsTestToolsDir, "ssl", "server.key")
+server.Setup.Copy(server_pem)
+server.Setup.Copy(server_key)
+server.Command = (
+    f"{sys.executable} {tr.RunDirectory}/continuation_origin.py "
+    f"{server_port} server.pem server.key 3 {stop_file}")

Review Comment:
   Three is intentional: the replay sends two requests, then the separate 
Verify both large response fields reach the client intact run invokes 
verify_continuation_headers.py, which sends the third request. Shutdown occurs 
after both runs. The test passes with the exact count of three; changing this 
to two would fail that validation.



##########
tests/gold_tests/h2/replay_h2_settings_ack/settings_ack.replay.yaml:
##########
@@ -0,0 +1,176 @@
+#  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.
+
+meta:
+  version: '1.0'
+
+# Five client requests exercise dynamic windows on the reused origin 
connection.
+
+sessions:
+  - protocol:
+      - name: http
+        version: '2'
+      - name: tls
+        sni: settings-ack.example.com
+      - name: tcp
+      - name: ip
+        version: '4'

Review Comment:
   Added explicit HTTP/2-over-TLS proxy-request protocol metadata to all five 
transactions, matching the pool-reuse replay. The SETTINGS-ACK AuTest passes 
with the rebuilt binary.



-- 
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