From 3c275d71a109cc716020bfc1a1ecf2e36a01cb0d Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Fri, 20 Nov 2020 01:06:13 +0000 Subject: [PATCH 1/2] Unify all the connect timeouts into one --- doc/admin-guide/files/records.config.en.rst | 17 ----------------- doc/admin-guide/performance/index.en.rst | 19 ------------------- .../functions/TSHttpOverridableConfig.en.rst | 2 -- include/ts/apidefs.h.in | 2 -- mgmt/RecordsConfig.cc | 4 ---- plugins/lua/ts_lua_http_config.c | 4 ---- proxy/http/HttpConfig.cc | 4 ---- proxy/http/HttpConfig.h | 2 -- proxy/http/HttpSM.cc | 10 +--------- src/shared/overridable_txn_vars.cc | 3 --- src/traffic_server/InkAPI.cc | 6 ------ src/traffic_server/InkAPITest.cc | 2 -- 12 files changed, 1 insertion(+), 74 deletions(-) diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst index 8d29b0aecfb..536ea7aecbd 100644 --- a/doc/admin-guide/files/records.config.en.rst +++ b/doc/admin-guide/files/records.config.en.rst @@ -1217,14 +1217,6 @@ Parent Proxy Configuration The total number of connection attempts allowed per parent for a specific transaction, if multiple parents are used. -.. ts:cv:: CONFIG proxy.config.http.parent_proxy.connect_attempts_timeout INT 30 - :reloadable: - :overridable: - - The timeout value (in seconds) for parent cache connection attempts. - - See :ref:`admin-performance-timeouts` for more discussion on |TS| timeouts. - .. ts:cv:: CONFIG proxy.config.http.parent_proxy.mark_down_hostdb INT 0 :reloadable: :overridable: @@ -1556,15 +1548,6 @@ Origin Server Connect Attempts See :ref:`admin-performance-timeouts` for more discussion on |TS| timeouts. -.. ts:cv:: CONFIG proxy.config.http.post_connect_attempts_timeout INT 1800 - :reloadable: - :overridable: - - The timeout value (in seconds) for an origin server connection when the client request is a ``POST`` or ``PUT`` - request. - - See :ref:`admin-performance-timeouts` for more discussion on |TS| timeouts. - .. ts:cv:: CONFIG proxy.config.http.post.check.content_length.enabled INT 1 Enables (``1``) or disables (``0``) checking the Content-Length: Header for a POST request. diff --git a/doc/admin-guide/performance/index.en.rst b/doc/admin-guide/performance/index.en.rst index 639c2af7e7e..67305447c65 100644 --- a/doc/admin-guide/performance/index.en.rst +++ b/doc/admin-guide/performance/index.en.rst @@ -331,28 +331,9 @@ connection attempt until the origin fully establishes a connection (the connecti After the connection is established the value of :ts:cv:`proxy.config.http.transaction_no_activity_timeout_out` is used to established timeouts on the data over the connection. -In the case where you wish to have a different (generally longer) timeout for -``POST`` and ``PUT`` connections to an origin server, you may also adjust -:ts:cv:`proxy.config.http.post_connect_attempts_timeout` which applies only to -origin connections using those HTTP verbs. - :: CONFIG proxy.config.http.connect_attempts_timeout INT 30 - CONFIG proxy.config.http.post_connect_attempts_timeout INT 1800 - -Parent Proxy Timeout -~~~~~~~~~~~~~~~~~~~~ - -In hierarchical caching configurations, the :ts:cv:`proxy.config.http.parent_proxy.connect_attempts_timeout` -setting is used for all connection attempts to parent caches. It may be useful, -in cases where you wish to have |TS| fall back to an alternate parent cache -(in configurations where you have multiple parents for the same cache) more -quickly, to lower this timeout. - -:: - - CONFIG proxy.config.http.parent_proxy.connect_attempts_timeout INT 30 Polling Timeout ~~~~~~~~~~~~~~~ diff --git a/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst b/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst index fae74b57b9e..2e70c110157 100644 --- a/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst +++ b/doc/developer-guide/api/functions/TSHttpOverridableConfig.en.rst @@ -140,7 +140,6 @@ TSOverridableConfigKey Value Configuratio :c:macro:`TS_CONFIG_HTTP_NEGATIVE_REVALIDATING_LIFETIME` :ts:cv:`proxy.config.http.negative_revalidating_lifetime` :c:macro:`TS_CONFIG_HTTP_NORMALIZE_AE` :ts:cv:`proxy.config.http.normalize_ae` :c:macro:`TS_CONFIG_HTTP_NUMBER_OF_REDIRECTIONS` :ts:cv:`proxy.config.http.number_of_redirections` -:c:macro:`TS_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT` :ts:cv:`proxy.config.http.parent_proxy.connect_attempts_timeout` :c:macro:`TS_CONFIG_HTTP_PARENT_PROXY_FAIL_THRESHOLD` :ts:cv:`proxy.config.http.parent_proxy.fail_threshold` :c:macro:`TS_CONFIG_HTTP_PARENT_PROXY_RETRY_TIME` :ts:cv:`proxy.config.http.parent_proxy.retry_time` :c:macro:`TS_CONFIG_HTTP_PARENT_PROXY_TOTAL_CONNECT_ATTEMPTS` :ts:cv:`proxy.config.http.parent_proxy.total_connect_attempts` @@ -148,7 +147,6 @@ TSOverridableConfigKey Value Configuratio :c:macro:`TS_CONFIG_HTTP_PER_SERVER_CONNECTION_MATCH` :ts:cv:`proxy.config.http.per_server.connection.match` :c:macro:`TS_CONFIG_HTTP_PER_SERVER_CONNECTION_MAX` :ts:cv:`proxy.config.http.per_server.connection.max` :c:macro:`TS_CONFIG_HTTP_POST_CHECK_CONTENT_LENGTH_ENABLED` :ts:cv:`proxy.config.http.post.check.content_length.enabled` -:c:macro:`TS_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT` :ts:cv:`proxy.config.http.post_connect_attempts_timeout` :c:macro:`TS_CONFIG_HTTP_REDIRECT_USE_ORIG_CACHE_KEY` :ts:cv:`proxy.config.http.redirect_use_orig_cache_key` :c:macro:`TS_CONFIG_HTTP_REQUEST_BUFFER_ENABLED` :ts:cv:`proxy.config.http.request_buffer_enabled` :c:macro:`TS_CONFIG_HTTP_REQUEST_HEADER_MAX_SIZE` :ts:cv:`proxy.config.http.request_header_max_size` diff --git a/include/ts/apidefs.h.in b/include/ts/apidefs.h.in index 93098b1f8a9..ec8984c7d7e 100644 --- a/include/ts/apidefs.h.in +++ b/include/ts/apidefs.h.in @@ -726,7 +726,6 @@ typedef enum { TS_CONFIG_HTTP_CONNECT_ATTEMPTS_MAX_RETRIES_DEAD_SERVER, TS_CONFIG_HTTP_CONNECT_ATTEMPTS_RR_RETRIES, TS_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT, - TS_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT, TS_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME, TS_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD, TS_CONFIG_HTTP_DOC_IN_CACHE_SKIP_DNS, @@ -782,7 +781,6 @@ typedef enum { TS_CONFIG_HTTP_PARENT_PROXY_FAIL_THRESHOLD, TS_CONFIG_HTTP_PARENT_PROXY_RETRY_TIME, TS_CONFIG_HTTP_PER_PARENT_CONNECT_ATTEMPTS, - TS_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT, TS_CONFIG_HTTP_NORMALIZE_AE, TS_CONFIG_HTTP_INSERT_FORWARDED, TS_CONFIG_HTTP_PROXY_PROTOCOL_OUT, diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc index 261aae800dc..9dff9c2c992 100644 --- a/mgmt/RecordsConfig.cc +++ b/mgmt/RecordsConfig.cc @@ -429,8 +429,6 @@ static const RecordElement RecordsConfig[] = , {RECT_CONFIG, "proxy.config.http.parent_proxy.per_parent_connect_attempts", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL} , - {RECT_CONFIG, "proxy.config.http.parent_proxy.connect_attempts_timeout", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL} - , {RECT_CONFIG, "proxy.config.http.parent_proxy.mark_down_hostdb", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL} , {RECT_CONFIG, "proxy.config.http.parent_proxy.self_detect", RECD_INT, "2", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL} @@ -485,8 +483,6 @@ static const RecordElement RecordsConfig[] = , {RECT_CONFIG, "proxy.config.http.connect_attempts_timeout", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL} , - {RECT_CONFIG, "proxy.config.http.post_connect_attempts_timeout", RECD_INT, "1800", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL} - , {RECT_CONFIG, "proxy.config.http.down_server.cache_time", RECD_INT, "60", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL} , {RECT_CONFIG, "proxy.config.http.down_server.abort_threshold", RECD_INT, "10", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL} diff --git a/plugins/lua/ts_lua_http_config.c b/plugins/lua/ts_lua_http_config.c index 4f6f26b0f5b..cb753469065 100644 --- a/plugins/lua/ts_lua_http_config.c +++ b/plugins/lua/ts_lua_http_config.c @@ -71,7 +71,6 @@ typedef enum { TS_LUA_CONFIG_HTTP_CONNECT_ATTEMPTS_MAX_RETRIES_DEAD_SERVER = TS_CONFIG_HTTP_CONNECT_ATTEMPTS_MAX_RETRIES_DEAD_SERVER, TS_LUA_CONFIG_HTTP_CONNECT_ATTEMPTS_RR_RETRIES = TS_CONFIG_HTTP_CONNECT_ATTEMPTS_RR_RETRIES, TS_LUA_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT = TS_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT, - TS_LUA_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT = TS_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT, TS_LUA_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME = TS_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME, TS_LUA_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD = TS_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD, TS_LUA_CONFIG_HTTP_DOC_IN_CACHE_SKIP_DNS = TS_CONFIG_HTTP_DOC_IN_CACHE_SKIP_DNS, @@ -127,7 +126,6 @@ typedef enum { TS_LUA_CONFIG_HTTP_PARENT_PROXY_FAIL_THRESHOLD = TS_CONFIG_HTTP_PARENT_PROXY_FAIL_THRESHOLD, TS_LUA_CONFIG_HTTP_PARENT_PROXY_RETRY_TIME = TS_CONFIG_HTTP_PARENT_PROXY_RETRY_TIME, TS_LUA_CONFIG_HTTP_PER_PARENT_CONNECT_ATTEMPTS = TS_CONFIG_HTTP_PER_PARENT_CONNECT_ATTEMPTS, - TS_LUA_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT = TS_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT, TS_LUA_CONFIG_HTTP_ALLOW_MULTI_RANGE = TS_CONFIG_HTTP_ALLOW_MULTI_RANGE, TS_LUA_CONFIG_HTTP_REQUEST_BUFFER_ENABLED = TS_CONFIG_HTTP_REQUEST_BUFFER_ENABLED, TS_LUA_CONFIG_HTTP_ALLOW_HALF_OPEN = TS_CONFIG_HTTP_ALLOW_HALF_OPEN, @@ -198,7 +196,6 @@ ts_lua_var_item ts_lua_http_config_vars[] = { TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CONNECT_ATTEMPTS_MAX_RETRIES_DEAD_SERVER), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CONNECT_ATTEMPTS_RR_RETRIES), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CONNECT_ATTEMPTS_TIMEOUT), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_DOWN_SERVER_ABORT_THRESHOLD), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_DOC_IN_CACHE_SKIP_DNS), @@ -254,7 +251,6 @@ ts_lua_var_item ts_lua_http_config_vars[] = { TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_PARENT_PROXY_FAIL_THRESHOLD), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_PARENT_PROXY_RETRY_TIME), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_PER_PARENT_CONNECT_ATTEMPTS), - TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ALLOW_MULTI_RANGE), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_REQUEST_BUFFER_ENABLED), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_ALLOW_HALF_OPEN), diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc index daafac8b563..756ecbc7b43 100644 --- a/proxy/http/HttpConfig.cc +++ b/proxy/http/HttpConfig.cc @@ -1200,13 +1200,11 @@ HttpConfig::startup() HttpEstablishStaticConfigLongLong(c.oride.connect_attempts_rr_retries, "proxy.config.http.connect_attempts_rr_retries"); HttpEstablishStaticConfigLongLong(c.oride.connect_attempts_timeout, "proxy.config.http.connect_attempts_timeout"); - HttpEstablishStaticConfigLongLong(c.oride.post_connect_attempts_timeout, "proxy.config.http.post_connect_attempts_timeout"); HttpEstablishStaticConfigLongLong(c.oride.parent_connect_attempts, "proxy.config.http.parent_proxy.total_connect_attempts"); HttpEstablishStaticConfigLongLong(c.oride.parent_retry_time, "proxy.config.http.parent_proxy.retry_time"); HttpEstablishStaticConfigLongLong(c.oride.parent_fail_threshold, "proxy.config.http.parent_proxy.fail_threshold"); HttpEstablishStaticConfigLongLong(c.oride.per_parent_connect_attempts, "proxy.config.http.parent_proxy.per_parent_connect_attempts"); - HttpEstablishStaticConfigLongLong(c.oride.parent_connect_timeout, "proxy.config.http.parent_proxy.connect_attempts_timeout"); HttpEstablishStaticConfigByte(c.oride.parent_failures_update_hostdb, "proxy.config.http.parent_proxy.mark_down_hostdb"); HttpEstablishStaticConfigLongLong(c.oride.sock_recv_buffer_size_out, "proxy.config.net.sock_recv_buffer_size_out"); @@ -1475,12 +1473,10 @@ HttpConfig::reconfigure() } params->oride.connect_attempts_rr_retries = m_master.oride.connect_attempts_rr_retries; params->oride.connect_attempts_timeout = m_master.oride.connect_attempts_timeout; - params->oride.post_connect_attempts_timeout = m_master.oride.post_connect_attempts_timeout; params->oride.parent_connect_attempts = m_master.oride.parent_connect_attempts; params->oride.parent_retry_time = m_master.oride.parent_retry_time; params->oride.parent_fail_threshold = m_master.oride.parent_fail_threshold; params->oride.per_parent_connect_attempts = m_master.oride.per_parent_connect_attempts; - params->oride.parent_connect_timeout = m_master.oride.parent_connect_timeout; params->oride.parent_failures_update_hostdb = m_master.oride.parent_failures_update_hostdb; params->oride.sock_recv_buffer_size_out = m_master.oride.sock_recv_buffer_size_out; diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h index 8bce9393f0c..718de047119 100644 --- a/proxy/http/HttpConfig.h +++ b/proxy/http/HttpConfig.h @@ -648,7 +648,6 @@ struct OverridableHttpConfigParams { MgmtInt connect_attempts_max_retries_dead_server = 3; MgmtInt connect_attempts_rr_retries = 3; MgmtInt connect_attempts_timeout = 30; - MgmtInt post_connect_attempts_timeout = 1800; //////////////////////////////////// // parent proxy connect attempts // @@ -657,7 +656,6 @@ struct OverridableHttpConfigParams { MgmtInt parent_retry_time = 300; MgmtInt parent_fail_threshold = 10; MgmtInt per_parent_connect_attempts = 2; - MgmtInt parent_connect_timeout = 30; MgmtInt down_server_timeout = 300; MgmtInt client_abort_threshold = 10; diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc index 6af96020aec..8991ceb6455 100644 --- a/proxy/http/HttpSM.cc +++ b/proxy/http/HttpSM.cc @@ -346,15 +346,7 @@ HttpSM::get_server_connect_timeout() if (t_state.api_txn_connect_timeout_value != -1) { retval = HRTIME_MSECONDS(t_state.api_txn_connect_timeout_value); } else { - int connect_timeout; - if (t_state.method == HTTP_WKSIDX_POST || t_state.method == HTTP_WKSIDX_PUT) { - connect_timeout = t_state.txn_conf->post_connect_attempts_timeout; - } else if (t_state.current.server == &t_state.parent_info) { - connect_timeout = t_state.txn_conf->parent_connect_timeout; - } else { - connect_timeout = t_state.txn_conf->connect_attempts_timeout; - } - retval = HRTIME_SECONDS(connect_timeout); + retval = HRTIME_SECONDS(t_state.txn_conf->connect_attempts_timeout); } return retval; } diff --git a/src/shared/overridable_txn_vars.cc b/src/shared/overridable_txn_vars.cc index 667416ec3ca..398bf2b564a 100644 --- a/src/shared/overridable_txn_vars.cc +++ b/src/shared/overridable_txn_vars.cc @@ -114,7 +114,6 @@ const std::unordered_mapconnect_attempts_timeout, conv); break; - case TS_CONFIG_HTTP_POST_CONNECT_ATTEMPTS_TIMEOUT: - ret = _memberp_to_generic(&overridableHttpConfig->post_connect_attempts_timeout, conv); - break; case TS_CONFIG_HTTP_DOWN_SERVER_CACHE_TIME: ret = _memberp_to_generic(&overridableHttpConfig->down_server_timeout, conv); break; @@ -8758,9 +8755,6 @@ _conf_to_memberp(TSOverridableConfigKey conf, OverridableHttpConfigParams *overr case TS_CONFIG_HTTP_PER_PARENT_CONNECT_ATTEMPTS: ret = _memberp_to_generic(&overridableHttpConfig->per_parent_connect_attempts, conv); break; - case TS_CONFIG_HTTP_PARENT_CONNECT_ATTEMPT_TIMEOUT: - ret = _memberp_to_generic(&overridableHttpConfig->parent_connect_timeout, conv); - break; case TS_CONFIG_HTTP_ALLOW_MULTI_RANGE: ret = _memberp_to_generic(&overridableHttpConfig->allow_multi_range, conv); break; diff --git a/src/traffic_server/InkAPITest.cc b/src/traffic_server/InkAPITest.cc index 3405755723c..c5534544aa7 100644 --- a/src/traffic_server/InkAPITest.cc +++ b/src/traffic_server/InkAPITest.cc @@ -8624,7 +8624,6 @@ std::array SDK_Overridable_Configs = { "proxy.config.http.connect_attempts_max_retries_dead_server", "proxy.config.http.connect_attempts_rr_retries", "proxy.config.http.connect_attempts_timeout", - "proxy.config.http.post_connect_attempts_timeout", "proxy.config.http.down_server.cache_time", "proxy.config.http.down_server.abort_threshold", "proxy.config.http.doc_in_cache_skip_dns", @@ -8679,7 +8678,6 @@ std::array SDK_Overridable_Configs = { "proxy.config.http.parent_proxy.fail_threshold", "proxy.config.http.parent_proxy.retry_time", "proxy.config.http.parent_proxy.per_parent_connect_attempts", - "proxy.config.http.parent_proxy.connect_attempts_timeout", "proxy.config.http.normalize_ae", "proxy.config.http.insert_forwarded", "proxy.config.http.proxy_protocol_out", From 2da1868433aa14b8342ccc17672182dfe8038541 Mon Sep 17 00:00:00 2001 From: Susan Hinrichs Date: Thu, 18 Feb 2021 20:22:15 +0000 Subject: [PATCH 2/2] Update what's new --- doc/release-notes/whats-new.en.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/release-notes/whats-new.en.rst b/doc/release-notes/whats-new.en.rst index 0500df49c43..eb641e68a11 100644 --- a/doc/release-notes/whats-new.en.rst +++ b/doc/release-notes/whats-new.en.rst @@ -35,6 +35,12 @@ New Features New or modified Configurations ------------------------------ +Combined Connect Timeouts +^^^^^^^^^^^^^^^^^^^^^^^^^ + +The configuration settings :ts:cv: `proxy.config.http.parent_proxy.connect_attempts_timeout` and :ts:cv: `proxy.config.http.post_connect_attempts_timeout` have been removed. +All connect timeouts are controlled by :ts:cv: `proxy.config.http.connect_attempts_timeout`. + Logging and Metrics -------------------