Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions doc/admin-guide/files/records.yaml.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1833,9 +1833,13 @@ Origin Server Connect Attempts
.. ts:cv:: CONFIG proxy.config.http.connect.down.policy INT 2
:overridable:

Controls what origin server connection failures contribute to marking a server down. When set to 2, any connection failure during the TCP and TLS
handshakes will contribute to marking the server down. When set to 1, only TCP handshake failures will contribute to marking a server down.
When set to 0, no connection failures will be used towards marking a server down.
Controls what origin server connection failures contribute to marking a server down.
When set to ``2``, any connection failure during the TCP and TLS handshakes will
contribute to marking the server down. When set to ``1``, only TCP handshake failures
will contribute to marking a server down. When set to ``0``, no connection failures
will be used towards marking a server down. When set to ``3``, all failures covered
by ``2`` plus transaction inactive timeouts (server goes silent after connection is
established) will contribute to marking a server down.

Comment thread
vmamidi marked this conversation as resolved.
.. ts:cv:: CONFIG proxy.config.http.server_max_connections INT 0
:reloadable:
Expand Down
8 changes: 7 additions & 1 deletion src/proxy/http/HttpSM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4671,12 +4671,18 @@ HttpSM::track_connect_fail() const
bool retval = false;
if (t_state.current.server->had_connect_fail()) {
// What does our policy say?
if (t_state.txn_conf->connect_down_policy == 2) { // Any connection error through TLS handshake
if (t_state.txn_conf->connect_down_policy == 2 ||
t_state.txn_conf->connect_down_policy == 3) { // Any connection error through TLS handshake
Comment thread
vmamidi marked this conversation as resolved.
Copy link
Copy Markdown
Contributor

@masaori335 masaori335 Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to make this config bit mask, it'll allow us to choose combination of policies when we have more policies.

retval = true;
} else if (t_state.txn_conf->connect_down_policy == 1) { // Any connection error through TCP
retval = t_state.current.server->connect_result != -ENET_SSL_CONNECT_FAILED;
}
}
// Policy 3 additionally marks the server down on transaction inactive timeout,
// even when had_connect_fail() is false (connect_result was cleared at CONNECTION_ALIVE).
if (!retval && t_state.txn_conf->connect_down_policy == 3) {
retval = (t_state.current.server->state == HttpTransact::INACTIVE_TIMEOUT);
}
Comment thread
vmamidi marked this conversation as resolved.
return retval;
}

Expand Down