yknoya commented on code in PR #12729:
URL: https://github.com/apache/trafficserver/pull/12729#discussion_r2621982459
##########
src/proxy/http/ConnectingEntry.cc:
##########
@@ -139,7 +139,9 @@ ConnectingEntry::state_http_server_open(int event, void
*data)
while (!connect_sms.empty()) {
auto entry = connect_sms.begin();
SCOPED_MUTEX_LOCK(lock, (*entry)->mutex, this_ethread());
- (*entry)->t_state.set_connect_fail(lerrno);
+ if (lerrno != -UNKNOWN_INTERNAL_ERROR) {
+ (*entry)->t_state.set_fail(lerrno);
+ }
Review Comment:
In cases where a connection timeout occurs, the code path temporarily
assigned `EIO` (5) before ultimately setting `ETIMEDOUT` (110), as shown in the
logs below.
Assigning an incorrect intermediate errno is undesirable, so this change
ensures that an inappropriate errno is not set during the transition.
```
[Dec 16 15:23:26.800] [ET_NET 0] DIAG: <ConnectingEntry.cc:48
(state_http_server_open)> (http_connect) entered inside
ConnectingEntry::state_http_server_open
[Dec 16 15:23:26.800] [ET_NET 0] DIAG: <ConnectingEntry.cc:130
(state_http_server_open)> (http_connect) Stop 1 state machines waiting for
failed origin
[Dec 16 15:23:26.800] [ET_NET 0] DIAG: <TLSEventSupport.cc:153 (callHooks)>
(ssl) sslHandshakeHookState=TS_SSL_HOOK_PRE_CONNECT eventID=110
[Dec 16 15:23:26.800] [ET_NET 0] DIAG: <TLSEventSupport.cc:271 (callHooks)>
(ssl) iterated to curHook=(nil)
[Dec 16 15:23:26.800] [ET_NET 0] DIAG: <HttpTransact.h:933 (set_fail)>
(http) Setting upstream connection failure -19999 to 5
[Dec 16 15:23:26.800] [ET_NET 0] DIAG: <HttpSM.cc:2645 (main_handler)>
(http) [0] VC_EVENT_INACTIVITY_TIMEOUT/TS_EVENT_VCONN_INACTIVITY_TIMEOUT, 105
[Dec 16 15:23:26.800] [ET_NET 0] DIAG: <HttpSM.cc:1796
(state_http_server_open)> (http_track) [0] entered inside
state_http_server_open:
VC_EVENT_INACTIVITY_TIMEOUT/TS_EVENT_VCONN_INACTIVITY_TIMEOUT
[Dec 16 15:23:26.800] [ET_NET 0] DIAG: <HttpSM.cc:1797
(state_http_server_open)> (http) [0] [&HttpSM::state_http_server_open,
VC_EVENT_INACTIVITY_TIMEOUT/TS_EVENT_VCONN_INACTIVITY_TIMEOUT]
[Dec 16 15:23:26.800] [ET_NET 0] DIAG: <HttpTransact.h:933 (set_fail)>
(http) Setting upstream connection failure 5 to 110
[Dec 16 15:23:26.800] [ET_NET 0] DIAG: <HttpTransact.cc:3432
(HandleResponse)> (http_trans) [0] Entering HttpTransact::HandleResponse
```
--
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]