You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2023/01/05 20:57:15 UTC

[trafficserver] branch 9.2.x updated: Do not track config file periodically (#9285)

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
     new 553506b3b Do not track config file periodically (#9285)
553506b3b is described below

commit 553506b3bdb07bc8c51260e8423a27f1bff2b710
Author: Vijay Mamidi <vi...@yahoo.com>
AuthorDate: Thu Jan 5 12:43:40 2023 -0800

    Do not track config file periodically (#9285)
    
    * Do not track config file periodically
    
    * Do not track config file periodically
    
    * Do not track config file periodically
    
    * Do not track config files peridically
    
    * Do not track config files peridically
    
    Co-authored-by: Vijay Mamidi <vm...@apple.com>
    (cherry picked from commit dd946241686e7b3686cee8381248190123c5120e)
---
 doc/admin-guide/files/records.config.en.rst | 13 +++++++++++++
 lib/records/RecLocal.cc                     |  6 +++---
 mgmt/RecordsConfig.cc                       |  2 ++
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst
index 384a0fd01..5dc6670f5 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -601,6 +601,19 @@ Local Manager
    This setting is not reloadable, since it is must be applied when
    :program:`traffic_manager` initializes.
 
+.. ts:cv:: CONFIG proxy.config.track_config_files INT 1
+
+   Enables (``1``) or disables (``0``) tracking configuration file updates.
+   This setting is enabled by default, meaning that configuration files are monitored for changes.
+   Having tracking enabled is a dependency for :option:`traffic_ctl config status` to function. However,
+   tracking the files is implemented via a frequent call to ``stat()`` which may be problematic
+   in some deployments. If the call to ``stat()`` on configuration files causes problems, then
+   it can be avoided by setting this value to ``0`` at the cost of disabling the config status feature
+   for :program:`traffic_ctl`.
+
+   This setting is not reloadable, since it is must be applied when
+   :program:`traffic_manager` initializes.
+
 .. ts:cv:: CONFIG proxy.node.config.manager_exponential_sleep_ceiling INT 60
 
    In case of :program:`traffic_manager` is unable to start :program:`traffic_server`,
diff --git a/lib/records/RecLocal.cc b/lib/records/RecLocal.cc
index 4604ef2b0..4539c01db 100644
--- a/lib/records/RecLocal.cc
+++ b/lib/records/RecLocal.cc
@@ -65,13 +65,13 @@ sync_thr(void *data)
   FileManager *configFiles = static_cast<FileManager *>(data);
 
   while (!TSSystemState::is_event_system_shut_down()) {
-    RecBool check = true;
-
     send_push_message();
     RecSyncStatsFile();
 
     // If we didn't successfully sync to disk, check whether we need to update ....
-    if (check) {
+    bool found;
+    int track_time = static_cast<int>(REC_readInteger("proxy.config.track_config_files", &found));
+    if (found && track_time > 0) {
       if (configFiles->isConfigStale()) {
         RecSetRecordInt("proxy.node.config.reconfigure_required", 1, REC_SOURCE_DEFAULT);
       }
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index d2658db13..eda1c043c 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -261,6 +261,8 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_CONFIG, "proxy.config.admin.api.restricted", RECD_INT, "0", RECU_RESTART_TM, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
   ,
+  {RECT_CONFIG, "proxy.config.track_config_files", RECD_INT, "1", RECU_RESTART_TM, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
+  ,
 
   //##############################################################################
   //#