This is an automated email from the ASF dual-hosted git repository.

cmcfarlen pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit bad17dcc50bdeebbf7b6584764656843578292b4
Author: Chris McFarlen <[email protected]>
AuthorDate: Tue Aug 19 17:55:41 2025 -0500

    Retry connect if server closes before receiving response (#12446)
    
    (cherry picked from commit 324918ebf3b33df3a54cf7ceffc4ab9a2be1b2c4)
---
 src/proxy/http/HttpSM.cc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/proxy/http/HttpSM.cc b/src/proxy/http/HttpSM.cc
index 7c548fa50a..6b0ea6fbaa 100644
--- a/src/proxy/http/HttpSM.cc
+++ b/src/proxy/http/HttpSM.cc
@@ -1925,13 +1925,15 @@ HttpSM::state_read_server_response_header(int event, 
void *data)
   switch (event) {
   case VC_EVENT_EOS:
     server_entry->eos = true;
+    // If we have received any bytes for this transaction do not retry
+    if (server_response_hdr_bytes > 0) {
+      
t_state.current.retry_attempts.maximize(t_state.configured_connect_attempts_max_retries());
+    }
+    break;
 
-  // Fall through
   case VC_EVENT_READ_READY:
   case VC_EVENT_READ_COMPLETE:
     // More data to parse
-    // Got some data, won't retry origin connection on error
-    
t_state.current.retry_attempts.maximize(t_state.configured_connect_attempts_max_retries());
     break;
 
   case VC_EVENT_ERROR:

Reply via email to