From 0a3e4eacd707b3a6e2021d64b65f1844802d695f Mon Sep 17 00:00:00 2001 From: James Peach Date: Tue, 27 Sep 2016 09:44:32 -0700 Subject: [PATCH] TS-4898: Switch proxy.config.hostdb.timeout from minutes to seconds. --- doc/admin-guide/files/records.config.en.rst | 10 +++++----- iocore/hostdb/HostDB.cc | 12 +++++++----- mgmt/RecordsConfig.cc | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst index 4d9a13bb1cd..199ffaad822 100644 --- a/doc/admin-guide/files/records.config.en.rst +++ b/doc/admin-guide/files/records.config.en.rst @@ -2388,14 +2388,14 @@ HostDB ===== ====================================================================== .. ts:cv:: CONFIG proxy.config.hostdb.timeout INT 1440 - :units: minutes + :units: seconds :reloadable: - Internal time to live value for host DB entries, **in minutes**. - - See :ts:cv:`proxy.config.hostdb.ttl_mode` for when this value is used. + Internal time to live value for host DB entries in seconds. - See :ref:`admin-performance-timeouts` for more discussion on |TS| timeouts. + See :ts:cv:`proxy.config.hostdb.ttl_mode` for when this value + is used. See :ref:`admin-performance-timeouts` for more discussion + on |TS| timeouts. .. ts:cv:: CONFIG proxy.config.hostdb.fail.timeout INT 0 diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc index 918d69ea756..b367b1b7048 100644 --- a/iocore/hostdb/HostDB.cc +++ b/iocore/hostdb/HostDB.cc @@ -1084,15 +1084,17 @@ HostDBContinuation::lookup_done(IpAddr const &ip, char const *aname, bool around case TTL_OBEY: break; case TTL_IGNORE: - ttl_seconds = hostdb_ip_timeout_interval * 60; + ttl_seconds = hostdb_ip_timeout_interval; break; case TTL_MIN: - if (hostdb_ip_timeout_interval * 60 < ttl_seconds) - ttl_seconds = hostdb_ip_timeout_interval * 60; + if (hostdb_ip_timeout_interval < ttl_seconds) { + ttl_seconds = hostdb_ip_timeout_interval; + } break; case TTL_MAX: - if (hostdb_ip_timeout_interval * 60 > ttl_seconds) - ttl_seconds = hostdb_ip_timeout_interval * 60; + if (hostdb_ip_timeout_interval > ttl_seconds) { + ttl_seconds = hostdb_ip_timeout_interval; + } break; } HOSTDB_SUM_DYN_STAT(hostdb_ttl_stat, ttl_seconds); diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc index f82f8078f80..23d27ab0886 100644 --- a/mgmt/RecordsConfig.cc +++ b/mgmt/RecordsConfig.cc @@ -1056,7 +1056,7 @@ static const RecordElement RecordsConfig[] = , {RECT_CONFIG, "proxy.config.hostdb.lookup_timeout", RECD_INT, "30", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL} , - {RECT_CONFIG, "proxy.config.hostdb.timeout", RECD_INT, "1440", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL} + {RECT_CONFIG, "proxy.config.hostdb.timeout", RECD_INT, "86400", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL} , {RECT_CONFIG, "proxy.config.hostdb.verify_after", RECD_INT, "720", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL} ,