Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions doc/admin-guide/files/records.config.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,7 @@ HTTP Connection Timeouts

.. ts:cv:: CONFIG proxy.config.http.transaction_active_timeout_in INT 900
:reloadable:
:overridable:

The maximum amount of time Traffic Server can remain connected to a client. If the transfer to the client is not complete before this
timeout expires, then Traffic Server closes the connection.
Expand Down
1 change: 1 addition & 0 deletions lib/ts/apidefs.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ typedef enum {
TS_CONFIG_WEBSOCKET_ACTIVE_TIMEOUT,
TS_CONFIG_HTTP_UNCACHEABLE_REQUESTS_BYPASS_PARENT,
TS_CONFIG_HTTP_PARENT_PROXY_TOTAL_CONNECT_ATTEMPTS,
TS_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_IN,
TS_CONFIG_LAST_ENTRY
} TSOverridableConfigKey;

Expand Down
2 changes: 2 additions & 0 deletions plugins/experimental/ts_lua/ts_lua_http_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ typedef enum {
TS_LUA_CONFIG_WEBSOCKET_ACTIVE_TIMEOUT = TS_CONFIG_WEBSOCKET_ACTIVE_TIMEOUT,
TS_LUA_CONFIG_HTTP_UNCACHEABLE_REQUESTS_BYPASS_PARENT = TS_CONFIG_HTTP_UNCACHEABLE_REQUESTS_BYPASS_PARENT,
TS_LUA_CONFIG_HTTP_PARENT_PROXY_TOTAL_CONNECT_ATTEMPTS = TS_CONFIG_HTTP_PARENT_PROXY_TOTAL_CONNECT_ATTEMPTS,
TS_LUA_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_IN = TS_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_IN,
TS_LUA_CONFIG_LAST_ENTRY = TS_CONFIG_LAST_ENTRY,
} TSLuaOverridableConfigKey;

Expand Down Expand Up @@ -228,6 +229,7 @@ ts_lua_var_item ts_lua_http_config_vars[] = {
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_WEBSOCKET_ACTIVE_TIMEOUT),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_UNCACHEABLE_REQUESTS_BYPASS_PARENT),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_PARENT_PROXY_TOTAL_CONNECT_ATTEMPTS),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_IN),
TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_LAST_ENTRY),
};

Expand Down
7 changes: 7 additions & 0 deletions proxy/InkAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7974,6 +7974,9 @@ _conf_to_memberp(TSOverridableConfigKey conf, OverridableHttpConfigParams *overr
case TS_CONFIG_HTTP_PARENT_PROXY_TOTAL_CONNECT_ATTEMPTS:
typ = OVERRIDABLE_TYPE_INT;
ret = &overridableHttpConfig->parent_connect_attempts;
case TS_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_IN:
typ = OVERRIDABLE_TYPE_INT;
ret = &overridableHttpConfig->transaction_active_timeout_in;
break;
// This helps avoiding compiler warnings, yet detect unhandled enum members.
case TS_CONFIG_NULL:
Expand Down Expand Up @@ -8527,6 +8530,10 @@ TSHttpTxnConfigFind(const char *name, int length, TSOverridableConfigKey *conf,
else if (!strncmp(name, "proxy.config.http.cache.guaranteed_max_lifetime", length))
cnf = TS_CONFIG_HTTP_CACHE_GUARANTEED_MAX_LIFETIME;
break;
case 'n':
if (!strncmp(name, "proxy.config.http.transaction_active_timeout_in", length))
cnf = TS_CONFIG_HTTP_TRANSACTION_ACTIVE_TIMEOUT_IN;
break;
case 't':
if (!strncmp(name, "proxy.config.http.post_connect_attempts_timeout", length))
cnf = TS_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT;
Expand Down
1 change: 1 addition & 0 deletions proxy/InkAPITest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7355,6 +7355,7 @@ const char *SDK_Overridable_Configs[TS_CONFIG_LAST_ENTRY] = {
"proxy.config.websocket.active_timeout",
"proxy.config.http.uncacheable_requests_bypass_parent",
"proxy.config.http.parent_proxy.total_connect_attempts",
"proxy.config.http.transaction_active_timeout_in",
};

REGRESSION_TEST(SDK_API_OVERRIDABLE_CONFIGS)(RegressionTest *test, int /* atype ATS_UNUSED */, int *pstatus)
Expand Down
4 changes: 2 additions & 2 deletions proxy/http/HttpConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ HttpConfig::startup()
HttpEstablishStaticConfigLongLong(c.oride.websocket_active_timeout, "proxy.config.websocket.active_timeout");
HttpEstablishStaticConfigLongLong(c.oride.websocket_inactive_timeout, "proxy.config.websocket.no_activity_timeout");

HttpEstablishStaticConfigLongLong(c.transaction_active_timeout_in, "proxy.config.http.transaction_active_timeout_in");
HttpEstablishStaticConfigLongLong(c.oride.transaction_active_timeout_in, "proxy.config.http.transaction_active_timeout_in");
HttpEstablishStaticConfigLongLong(c.oride.transaction_active_timeout_out, "proxy.config.http.transaction_active_timeout_out");
HttpEstablishStaticConfigLongLong(c.accept_no_activity_timeout, "proxy.config.http.accept_no_activity_timeout");

Expand Down Expand Up @@ -1217,7 +1217,7 @@ HttpConfig::reconfigure()
params->oride.keep_alive_no_activity_timeout_out = m_master.oride.keep_alive_no_activity_timeout_out;
params->oride.transaction_no_activity_timeout_in = m_master.oride.transaction_no_activity_timeout_in;
params->oride.transaction_no_activity_timeout_out = m_master.oride.transaction_no_activity_timeout_out;
params->transaction_active_timeout_in = m_master.transaction_active_timeout_in;
params->oride.transaction_active_timeout_in = m_master.oride.transaction_active_timeout_in;
params->oride.transaction_active_timeout_out = m_master.oride.transaction_active_timeout_out;
params->oride.websocket_active_timeout = m_master.oride.websocket_active_timeout;
params->oride.websocket_inactive_timeout = m_master.oride.websocket_inactive_timeout;
Expand Down
4 changes: 2 additions & 2 deletions proxy/http/HttpConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ struct OverridableHttpConfigParams {
transaction_no_activity_timeout_in(30),
transaction_no_activity_timeout_out(30),
transaction_active_timeout_out(0),
transaction_active_timeout_in(900),
websocket_active_timeout(3600),
websocket_inactive_timeout(600),
origin_max_connections(0),
Expand Down Expand Up @@ -602,6 +603,7 @@ struct OverridableHttpConfigParams {
MgmtInt transaction_no_activity_timeout_in;
MgmtInt transaction_no_activity_timeout_out;
MgmtInt transaction_active_timeout_out;
MgmtInt transaction_active_timeout_in;
MgmtInt websocket_active_timeout;
MgmtInt websocket_inactive_timeout;
MgmtInt origin_max_connections;
Expand Down Expand Up @@ -738,7 +740,6 @@ struct HttpConfigParams : public ConfigInfo {
// connection variables. timeouts are in seconds //
///////////////////////////////////////////////////
MgmtByte session_auth_cache_keep_alive_enabled;
MgmtInt transaction_active_timeout_in;
MgmtInt accept_no_activity_timeout;

////////////////////////////////////
Expand Down Expand Up @@ -943,7 +944,6 @@ inline HttpConfigParams::HttpConfigParams()
url_expansions(NULL),
num_url_expansions(0),
session_auth_cache_keep_alive_enabled(1),
transaction_active_timeout_in(900),
accept_no_activity_timeout(120),
per_parent_connect_attempts(2),
parent_connect_timeout(30),
Expand Down
4 changes: 2 additions & 2 deletions proxy/http/HttpSM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ HttpSM::attach_client_session(ProxyClientTransaction *client_vc, IOBufferReader
/////////////////////////
// set up timeouts //
/////////////////////////
client_vc->set_inactivity_timeout(HRTIME_SECONDS(HttpConfig::m_master.accept_no_activity_timeout));
client_vc->set_active_timeout(HRTIME_SECONDS(HttpConfig::m_master.transaction_active_timeout_in));
client_vc->set_inactivity_timeout(HRTIME_SECONDS(t_state.http_config_param->accept_no_activity_timeout));
client_vc->set_active_timeout(HRTIME_SECONDS(t_state.txn_conf->transaction_active_timeout_in));

++reentrancy_count;
// Add our state sm to the sm list
Expand Down
3 changes: 3 additions & 0 deletions proxy/http/HttpTransact.cc
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,9 @@ HttpTransact::EndRemapRequest(State *s)
s->server_info.is_transparent = s->state_machine->ua_session ? s->state_machine->ua_session->is_outbound_transparent() : false;

done:
// We now set the active-timeout again, since it might have been changed as part of the remap rules.
s->state_machine->ua_session->get_netvc()->set_active_timeout(HRTIME_SECONDS(s->txn_conf->transaction_active_timeout_in));

if (is_debug_tag_set("http_chdr_describe") || is_debug_tag_set("http_trans") || is_debug_tag_set("url_rewrite")) {
DebugTxn("http_trans", "After Remapping:");
obj_describe(s->hdr_info.client_request.m_http, 1);
Expand Down