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

masaori pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new f2e959f416 Fix issue where origins could be unintentionally marked as 
down (#12729)
f2e959f416 is described below

commit f2e959f416a334183c1189f0e9d906b7a4511cf7
Author: Katsutoshi Ikenoya <[email protected]>
AuthorDate: Wed Dec 24 11:23:57 2025 +0900

    Fix issue where origins could be unintentionally marked as down (#12729)
    
    * Fix issue where origins could be unintentionally marked as down
    
    * Set connect_result only when an actual connection error is detected
    
    * Prevent unnecessary overwriting of error codes
    
    * Revert "Prevent unnecessary overwriting of error codes"
    
    This reverts commit 76cd57e8b574a7d0ff0d66fc784a9d0e97c460f5.
    
    * Revert "Set connect_result only when an actual connection error is 
detected"
    
    This reverts commit bd1c1920e3862d0dd4fa0e1f7771b3fa8b0572fc.
---
 src/proxy/http/HttpSM.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/proxy/http/HttpSM.cc b/src/proxy/http/HttpSM.cc
index 8b2b4477b6..87e8c85945 100644
--- a/src/proxy/http/HttpSM.cc
+++ b/src/proxy/http/HttpSM.cc
@@ -1823,6 +1823,9 @@ HttpSM::state_http_server_open(int event, void *data)
       _netvc->do_io_write(this, 1, _netvc_reader);
       _netvc->set_inactivity_timeout(this->get_server_connect_timeout());
 
+      // Pre-emptively set a server connect failure that will be cleared once 
a WRITE_READY is received from origin or
+      // bytes are received back
+      t_state.set_connect_fail(EIO);
     } else { // in the case of an intercept plugin don't to the connect 
timeout change
       SMDbg(dbg_ctl_http_connect, "not setting handler for connection 
handshake");
       this->create_server_txn(this->create_server_session(*_netvc, 
_netvc_read_buffer, _netvc_reader));
@@ -1841,6 +1844,7 @@ HttpSM::state_http_server_open(int event, void *data)
   case CONNECT_EVENT_TXN:
     SMDbg(dbg_ctl_http, "Connection handshake complete via CONNECT_EVENT_TXN");
     if (this->create_server_txn(static_cast<PoolableSession *>(data))) {
+      t_state.current.server->clear_connect_fail();
       handle_http_server_open();
     } else { // Failed to create transaction.  Maybe too many active 
transactions already
       // Try again (probably need a bounding counter here)
@@ -8045,9 +8049,6 @@ HttpSM::set_next_state()
   }
 
   case HttpTransact::StateMachineAction_t::ORIGIN_SERVER_OPEN: {
-    // Pre-emptively set a server connect failure that will be cleared once a 
WRITE_READY is received from origin or
-    // bytes are received back
-    t_state.set_connect_fail(EIO);
     HTTP_SM_SET_DEFAULT_HANDLER(&HttpSM::state_http_server_open);
 
     // We need to close the previous attempt

Reply via email to