[trafficserver] branch master updated (c23c5a4 -> 9f263ff)

2020-09-28 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


from c23c5a4  Log config reload: use new config for initialization (#7215)
 add 9f263ff  Fix renamed setting in default config (#7224)

No new revisions were added by this update.

Summary of changes:
 configs/records.config.default.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[trafficserver] branch 9.0.x updated: Updated ChangeLog

2020-09-28 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new cc17eb6  Updated ChangeLog
cc17eb6 is described below

commit cc17eb652dda3c6fc8deeb741b6af9eab9c634f9
Author: Leif Hedstrom 
AuthorDate: Mon Sep 28 14:39:27 2020 -0600

Updated ChangeLog
---
 CHANGELOG-9.0.0 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CHANGELOG-9.0.0 b/CHANGELOG-9.0.0
index 5fcb12b..2b5fa49 100644
--- a/CHANGELOG-9.0.0
+++ b/CHANGELOG-9.0.0
@@ -687,6 +687,7 @@ Changes with Apache Traffic Server 9.0.0
   #6011 - clang-analyzer: Add a null check
   #6013 - Add basic SystemTap markers support
   #6016 - Fix host type in host matcher.
+  #6019 - Minor cleanup of proxy/logging/Log.h .
   #6024 - Make proxy.config.http.request_buffer_enabled configurable and bug 
fix
   #6025 - Remove remnants of obsolete remap thread.
   #6026 - Remove obsolete 4-2-0-fixup



[trafficserver] 02/02: Log config reload: use new config for initialization (#7215)

2020-09-28 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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

commit 810a5aa8188e0e73d60d562f0308b6d9d74af0a8
Author: Brian Neradt 
AuthorDate: Mon Sep 28 13:19:37 2020 -0500

Log config reload: use new config for initialization (#7215)

Before this patch, a logging config reload would use the prior logging
configuration for all queries and log rotation auto deletion
registration. This updates the mechanism to use the new configuration
during this initialization phase.

(cherry picked from commit c23c5a4be0ebf000ed924819633b11ce036f928e)
---
 proxy/logging/Log.cc  | 21 
 proxy/logging/Log.h   |  5 ++
 proxy/logging/LogBuffer.cc| 16 +++---
 proxy/logging/LogBuffer.h |  6 ++-
 proxy/logging/LogConfig.cc|  2 +-
 proxy/logging/LogObject.cc| 28 +--
 proxy/logging/LogObject.h | 18 +++
 proxy/logging/RolledLogDeleter.cc |  4 ++
 proxy/logging/YamlLogConfig.cc|  4 +-
 proxy/logging/unit-tests/test_RolledLogDeleter.cc |  4 +-
 tests/gold_tests/logging/log_retention.test.py| 60 +++
 11 files changed, 120 insertions(+), 48 deletions(-)

diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index fe4afa3..c8508d3 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -99,8 +99,8 @@ make_alias_map(Ptr )
 void
 Log::change_configuration()
 {
-  LogConfig *prev   = Log::config;
-  LogConfig *new_config = nullptr;
+  LogConfig *prev_config = Log::config;
+  LogConfig *new_config  = nullptr;
 
   Debug("log-config", "Changing configuration ...");
 
@@ -111,10 +111,10 @@ Log::change_configuration()
   // grab the _APImutex so we can transfer the api objects to
   // the new config
   //
-  ink_mutex_acquire(prev->log_object_manager._APImutex);
+  ink_mutex_acquire(prev_config->log_object_manager._APImutex);
   Debug("log-api-mutex", "Log::change_configuration acquired api mutex");
 
-  new_config->init(Log::config);
+  new_config->init(prev_config);
 
   // Make the new LogConfig active.
   ink_atomic_swap(::config, new_config);
@@ -125,7 +125,7 @@ Log::change_configuration()
   // this happens, then the new TextLogObject will be immediately lost. Traffic
   // Server would crash the next time the plugin referenced the freed object.
 
-  ink_mutex_release(prev->log_object_manager._APImutex);
+  ink_mutex_release(prev_config->log_object_manager._APImutex);
   Debug("log-api-mutex", "Log::change_configuration released api mutex");
 
   // Register the new config in the config processor; the old one will now be 
scheduled for a
@@ -135,7 +135,7 @@ Log::change_configuration()
 
   // If we replaced the logging configuration, flush any log
   // objects that weren't transferred to the new config ...
-  prev->log_object_manager.flush_all_objects();
+  prev_config->log_object_manager.flush_all_objects();
 
   Debug("log-config", "... new configuration in place");
 }
@@ -1065,10 +1065,11 @@ Log::init_when_enabled()
 // setup global scrap object
 //
 global_scrap_format = MakeTextLogFormat();
-global_scrap_object = new LogObject(
-  global_scrap_format, Log::config->logfile_dir, "scrapfile.log", 
LOG_FILE_BINARY, nullptr, Log::config->rolling_enabled,
-  Log::config->preproc_threads, Log::config->rolling_interval_sec, 
Log::config->rolling_offset_hr, Log::config->rolling_size_mb,
-  /* auto create */ false, Log::config->rolling_max_count, 
Log::config->rolling_min_count);
+global_scrap_object =
+  new LogObject(Log::config, global_scrap_format, 
Log::config->logfile_dir, "scrapfile.log", LOG_FILE_BINARY, nullptr,
+Log::config->rolling_enabled, 
Log::config->preproc_threads, Log::config->rolling_interval_sec,
+Log::config->rolling_offset_hr, 
Log::config->rolling_size_mb,
+/* auto create */ false, Log::config->rolling_max_count, 
Log::config->rolling_min_count);
 
 // create the flush thread
 create_threads();
diff --git a/proxy/logging/Log.h b/proxy/logging/Log.h
index 2de6d87..74d8437 100644
--- a/proxy/logging/Log.h
+++ b/proxy/logging/Log.h
@@ -182,6 +182,11 @@ public:
 
   // public data members
   static LogObject *error_log;
+  /** The latest fully initialized LogConfig.
+   *
+   * This is the safe, fully initialed LogConfig object to query against when
+   * performing logging operations.
+   */
   static LogConfig *config;
   static LogFieldList global_field_list;
   static std::unordered_map field_symbol_hash;
diff --git a/proxy/logging/LogBuffer.cc b/proxy/logging/LogBuffer.cc
index 5dc19f4..466e34f 100644
--- a/proxy/logging/LogBuffer.cc
+++ b/proxy/logging/LogBuffer.cc
@@ -102,7 +102,7 @@ 

[trafficserver] 01/02: Minor cleanup of proxy/logging/Log.h .

2020-09-28 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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

commit b792696f59d5ac524cbad9114fe216cc0d40be4f
Author: Walter Karas 
AuthorDate: Mon Oct 14 17:02:36 2019 -0500

Minor cleanup of proxy/logging/Log.h .

(cherry picked from commit fd5901331a33d52af51ee97eefc73a614f4a56a3)
---
 proxy/logging/Log.h | 23 ++-
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/proxy/logging/Log.h b/proxy/logging/Log.h
index 01700a6..2de6d87 100644
--- a/proxy/logging/Log.h
+++ b/proxy/logging/Log.h
@@ -110,6 +110,10 @@ public:
 class Log
 {
 public:
+  // Prevent creation of any instances of this class.
+  //
+  Log() = delete;
+
   enum ReturnCodeFlags {
 LOG_OK = 1,
 SKIP   = 2,
@@ -153,21 +157,21 @@ public:
   static void init(int configFlags = 0);
   static void init_fields();
 
-  inkcoreapi static bool
+  static bool
   transaction_logging_enabled()
   {
 return (logging_mode == LOG_MODE_FULL || logging_mode == 
LOG_MODE_TRANSACTIONS);
   }
 
-  inkcoreapi static bool
+  static bool
   error_logging_enabled()
   {
 return (logging_mode == LOG_MODE_FULL || logging_mode == LOG_MODE_ERRORS);
   }
 
-  inkcoreapi static int access(LogAccess *lad);
-  inkcoreapi static int va_error(const char *format, va_list ap);
-  inkcoreapi static int error(const char *format, ...) TS_PRINTFLIKE(1, 2);
+  static int access(LogAccess *lad);
+  static int va_error(const char *format, va_list ap);
+  static int error(const char *format, ...) TS_PRINTFLIKE(1, 2);
 
   /
   // 'Wire tracing' enabled by source ip or by percentage of connections //
@@ -177,7 +181,7 @@ public:
   static void trace_va(bool in, const sockaddr *peer_addr, uint16_t peer_port, 
const char *format_string, va_list ap);
 
   // public data members
-  inkcoreapi static LogObject *error_log;
+  static LogObject *error_log;
   static LogConfig *config;
   static LogFieldList global_field_list;
   static std::unordered_map field_symbol_hash;
@@ -199,15 +203,8 @@ public:
   static int handle_logging_mode_change(const char *name, RecDataT data_type, 
RecData data, void *cookie);
   static int handle_periodic_tasks_int_change(const char *name, RecDataT 
data_type, RecData data, void *cookie);
 
-  Log(); // shut up stupid DEC C++ compiler
-
   friend void RegressionTest_LogObjectManager_Transfer(RegressionTest *, int, 
int *);
 
-  // noncopyable
-  // -- member functions that are not allowed --
-  Log(const Log ) = delete;
-  Log =(const Log ) = delete;
-
 private:
   static void periodic_tasks(long time_now);
   static void create_threads();



[trafficserver] branch 9.0.x updated (63bbbd7 -> 810a5aa)

2020-09-28 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


from 63bbbd7  Updated ChangeLog
 new b792696  Minor cleanup of proxy/logging/Log.h .
 new 810a5aa  Log config reload: use new config for initialization (#7215)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 proxy/logging/Log.cc  | 21 
 proxy/logging/Log.h   | 28 ++-
 proxy/logging/LogBuffer.cc| 16 +++---
 proxy/logging/LogBuffer.h |  6 ++-
 proxy/logging/LogConfig.cc|  2 +-
 proxy/logging/LogObject.cc| 28 +--
 proxy/logging/LogObject.h | 18 +++
 proxy/logging/RolledLogDeleter.cc |  4 ++
 proxy/logging/YamlLogConfig.cc|  4 +-
 proxy/logging/unit-tests/test_RolledLogDeleter.cc |  4 +-
 tests/gold_tests/logging/log_retention.test.py| 60 +++
 11 files changed, 130 insertions(+), 61 deletions(-)



[trafficserver] branch 9.0.x updated (9daae97 -> 63bbbd7)

2020-09-28 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


from 9daae97  autopep8: avoid running on non-tracked files. (#7186)
 add 63bbbd7  Updated ChangeLog

No new revisions were added by this update.

Summary of changes:
 CHANGELOG-9.0.0 | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)



[trafficserver] branch 9.0.x updated: autopep8: avoid running on non-tracked files. (#7186)

2020-09-28 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 9daae97  autopep8: avoid running on non-tracked files. (#7186)
9daae97 is described below

commit 9daae97b7c7854f08f6a736f925642853e28946b
Author: Brian Neradt 
AuthorDate: Mon Sep 14 11:37:52 2020 -0500

autopep8: avoid running on non-tracked files. (#7186)

It was found that if someone has non-commited Python files, such as can
happen if they have a virtual environment in their source tree, autopep8
will inspect those as well. This is slow and probably not desired by the
user.

This patch only runs autopep8 on files tracked by git. It will also
enable autopep8 to check .test.ext extensions, thus the updates to those
files.

It also has autopep8 run silently so it doesn't produce as much noise.

(cherry picked from commit a8150161bd2fbce3b67995e0ad8d65c2bc7e00ff)
---
 tests/gold_tests/autest-site/cli_tools.test.ext| 13 ++---
 tests/gold_tests/autest-site/conditions.test.ext   | 19 +---
 tests/gold_tests/autest-site/curl_header.test.ext  | 56 +++---
 tests/gold_tests/autest-site/init.cli.ext  |  2 +-
 tests/gold_tests/autest-site/ip.test.ext   |  3 ++
 tests/gold_tests/autest-site/microserver.test.ext  | 25 --
 tests/gold_tests/autest-site/setup.cli.ext |  2 +-
 .../gold_tests/autest-site/traffic_replay.test.ext |  8 +++-
 .../autest-site/trafficserver_plugins.test.ext | 20 
 tools/autopep8.sh  | 31 +++-
 tools/git/pre-commit   |  2 +
 11 files changed, 121 insertions(+), 60 deletions(-)

diff --git a/tests/gold_tests/autest-site/cli_tools.test.ext 
b/tests/gold_tests/autest-site/cli_tools.test.ext
index d82a30b..b253f03 100644
--- a/tests/gold_tests/autest-site/cli_tools.test.ext
+++ b/tests/gold_tests/autest-site/cli_tools.test.ext
@@ -31,19 +31,19 @@ Tools to help with TestRun commands
 #
 # Note that by default, the Default Process is created in this function.
 
-def spawn_commands(self, cmdstr, count, retcode = 0, use_default=True):
-ret=[]
+def spawn_commands(self, cmdstr, count, retcode=0, use_default=True):
+ret = []
 
 if use_default:
 count = int(count) - 1
-for cnt in range(0,count):
+for cnt in range(0, count):
 ret.append(
 self.Processes.Process(
 name="cmdline-{num}".format(num=cnt),
-cmdstr = cmdstr,
-returncode = retcode
-)
+cmdstr=cmdstr,
+returncode=retcode
 )
+)
 if use_default:
 self.Processes.Default.Command = cmdstr
 self.Processes.Default.ReturnCode = retcode
@@ -52,4 +52,5 @@ def spawn_commands(self, cmdstr, count, retcode = 0, 
use_default=True):
 )
 return ret
 
+
 ExtendTestRun(spawn_commands, name="SpawnCommands")
diff --git a/tests/gold_tests/autest-site/conditions.test.ext 
b/tests/gold_tests/autest-site/conditions.test.ext
index a8a91c6..c9d3a0d 100644
--- a/tests/gold_tests/autest-site/conditions.test.ext
+++ b/tests/gold_tests/autest-site/conditions.test.ext
@@ -20,9 +20,10 @@ import subprocess
 import json
 import re
 
+
 def HasOpenSSLVersion(self, version):
 output = subprocess.check_output(
-os.path.join(self.Variables.BINDIR, "traffic_layout") + " info 
--versions --json", shell = True
+os.path.join(self.Variables.BINDIR, "traffic_layout") + " info 
--versions --json", shell=True
 )
 json_data = output.decode('utf-8')
 openssl_str = json.loads(json_data)['openssl_str']
@@ -34,8 +35,10 @@ def HasOpenSSLVersion(self, version):
 "openssl library version is " + exe_ver + ", must be at least " + 
version
 )
 
+
 def HasCurlVersion(self, version):
-return self.EnsureVersion(["curl","--version"],min_version=version)
+return self.EnsureVersion(["curl", "--version"], min_version=version)
+
 
 def HasCurlFeature(self, feature):
 
@@ -58,6 +61,8 @@ def HasCurlFeature(self, feature):
 default,
 "Curl needs to support feature: {feature}".format(feature=feature)
 )
+
+
 def HasCurlOption(self, option):
 def default(output):
 tag = option.lower()
@@ -75,20 +80,23 @@ def HasCurlOption(self, option):
 "Curl needs to support option: {option}".format(option=option)
 )
 
+
 def HasATSFeature(self, feature):
 
 val = self.Variables.get(feature, None)
 
 return self.Condition(
-lambda: val == True,
+lambda: val,
 "ATS feature not enabled: {feature}".format(feature=feature)
 )
 
-#test if a plugin exists in the libexec folder
+# test if a plugin exists in the libexec folder
+
+
 def PluginExists(self, pluginname):
 
 path = 

[trafficserver] branch 9.0.x updated: Rename ambiguous log variable (#7199)

2020-09-28 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new f074d51  Rename ambiguous log variable (#7199)
f074d51 is described below

commit f074d513d27479a682d30212cba0261e622ac74f
Author: Masakazu Kitajo 
AuthorDate: Fri Sep 18 09:04:10 2020 +0900

Rename ambiguous log variable (#7199)

(cherry picked from commit bb5c3908697ad442dc8a4078cdb13be09448dadb)
---
 .../cpp-api/logger_example/LoggerExample.cc| 32 +++---
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/example/plugins/cpp-api/logger_example/LoggerExample.cc 
b/example/plugins/cpp-api/logger_example/LoggerExample.cc
index f6b1bfe..9e9561a 100644
--- a/example/plugins/cpp-api/logger_example/LoggerExample.cc
+++ b/example/plugins/cpp-api/logger_example/LoggerExample.cc
@@ -33,7 +33,7 @@ using std::string;
 
 namespace
 {
-Logger log;
+Logger logger;
 GlobalPlugin *plugin;
 } // namespace
 
@@ -61,7 +61,7 @@ public:
   void
   handleReadRequestHeadersPostRemap(Transaction ) override
   {
-LOG_DEBUG(log,
+LOG_DEBUG(logger,
   "handleReadRequestHeadersPostRemap.\n"
   "\tRequest URL: %s\n"
   "\tRequest Path: %s\n"
@@ -74,23 +74,23 @@ public:
 // Next, to demonstrate how you can change logging levels:
 if (transaction.getClientRequest().getUrl().getPath() == 
"change_log_level") {
   if 
(transaction.getClientRequest().getUrl().getQuery().find("level=debug") != 
string::npos) {
-log.setLogLevel(Logger::LOG_LEVEL_DEBUG);
-LOG_DEBUG(log, "Changed log level to DEBUG");
+logger.setLogLevel(Logger::LOG_LEVEL_DEBUG);
+LOG_DEBUG(logger, "Changed log level to DEBUG");
   } else if 
(transaction.getClientRequest().getUrl().getQuery().find("level=info") != 
string::npos) {
-log.setLogLevel(Logger::LOG_LEVEL_INFO);
-LOG_INFO(log, "Changed log level to INFO");
+logger.setLogLevel(Logger::LOG_LEVEL_INFO);
+LOG_INFO(logger, "Changed log level to INFO");
   } else if 
(transaction.getClientRequest().getUrl().getQuery().find("level=error") != 
string::npos) {
-log.setLogLevel(Logger::LOG_LEVEL_ERROR);
-LOG_ERROR(log, "Changed log level to ERROR");
+logger.setLogLevel(Logger::LOG_LEVEL_ERROR);
+LOG_ERROR(logger, "Changed log level to ERROR");
   }
 }
 
 // One drawback to using the Traffic Server Text Loggers is that you're 
limited in the size of the log
 // lines, this limit is now set at 8kb for atscppapi, but this limit might 
be removed in the future.
-LOG_INFO(log, "This message will be dropped (see error.log) because it's 
just too big: %s", big_buffer_14kb_);
+LOG_INFO(logger, "This message will be dropped (see error.log) because 
it's just too big: %s", big_buffer_14kb_);
 
 // This should work though:
-LOG_INFO(log, "%s", big_buffer_6kb_);
+LOG_INFO(logger, "%s", big_buffer_6kb_);
 
 transaction.resume();
   }
@@ -119,24 +119,24 @@ TSPluginInit(int argc ATSCPPAPI_UNUSED, const char 
*argv[] ATSCPPAPI_UNUSED)
   // The fifth argument is to enable log rolling, this is enabled by default.
   // The sixth argument is the frequency in which we will roll the logs, 300 
seconds is very low,
   //  the default for this argument is 3600.
-  log.init("logger_example", true, true, Logger::LOG_LEVEL_DEBUG, true, 300);
+  logger.init("logger_example", true, true, Logger::LOG_LEVEL_DEBUG, true, 
300);
 
   // Now that we've initialized a logger we can do all kinds of fun things on 
it:
-  log.setRollingEnabled(true);// already done via log.init, just an 
example.
-  log.setRollingIntervalSeconds(300); // already done via log.init
+  logger.setRollingEnabled(true);// already done via log.init, just an 
example.
+  logger.setRollingIntervalSeconds(300); // already done via log.init
 
   // You have two ways to log to a logger, you can log directly on the object 
itself:
-  log.logInfo("Hello World from: %s", argv[0]);
+  logger.logInfo("Hello World from: %s", argv[0]);
 
   // Alternatively you can take advantage of the super helper macros for 
logging
   // that will include the file, function, and line number automatically as 
part
   // of the log message:
-  LOG_INFO(log, "Hello World with more info from: %s", argv[0]);
+  LOG_INFO(logger, "Hello World with more info from: %s", argv[0]);
 
   // This will hurt performance, but it's an option that's always available to 
you
   // to force flush the logs. Otherwise TrafficServer will flush the logs 
around
   // once every second. You should really avoid flushing the log unless it's 
really necessary.
-  log.flush();
+  logger.flush();
 
   plugin = new GlobalHookPlugin();
 }



[trafficserver] 02/02: Docs cleanup (#7210)

2020-09-28 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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

commit d6a5be13dca637d5e0a8d2a1f129e3db421a3613
Author: Randall Meyer 
AuthorDate: Mon Sep 21 12:36:38 2020 -0700

Docs cleanup (#7210)

Remove references to ATS 2.x and 4.x, update examples for logging to YAML

(cherry picked from commit b8eb8104937494bdc8a802e95ead29511b556a1d)
---
 doc/admin-guide/files/records.config.en.rst  |  4 ++--
 doc/admin-guide/plugins/access_control.en.rst| 20 ++--
 .../cache-architecture/architecture.en.rst   |  4 ++--
 plugins/experimental/statichit/statichit.cc  |  2 +-
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index ca5e945..96ba3bc 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -537,10 +537,10 @@ Local Manager
process as, which also has the effect of setting ownership of configuration
and log files.
 
-   As of version 2.1.1 if the user_id is prefixed with pound character (``#``)
+   If the user_id is prefixed with pound character (``#``),
the remainder of the string is considered to be a
`numeric user identifier `_.
-   If the value is set to ``#-1`` |TS| will not change the user during startup.
+   If the value is set to ``#-1``, |TS| will not change the user during 
startup.
 
.. important::
 
diff --git a/doc/admin-guide/plugins/access_control.en.rst 
b/doc/admin-guide/plugins/access_control.en.rst
index d06d5ef..8fec83b 100644
--- a/doc/admin-guide/plugins/access_control.en.rst
+++ b/doc/admin-guide/plugins/access_control.en.rst
@@ -379,16 +379,16 @@ Configuration files
 
 * Format the ``access_control.log``
 
-.. code-block:: bash
-
-  access_control_format = format {
-Format = '% sub=%<{@TokenSubject}cqh> tid=%<{@TokenId}cqh> 
status=%<{@TokenStatus}cqh> cache=%<{x-cache}psh> key=%<{x-cache-key}psh>'  }
-
-  log.ascii {
-Filename = 'access_control',
-Format = access_control_format
-  }
-
+.. code-block:: yaml
+
+   logging:
+ formats:
+ - format: '% sub=%<{@TokenSubject}cqh> tid=%<{@TokenId}cqh> 
status=%<{@TokenStatus}cqh> cache=%<{x-cache}psh> key=%<{x-cache-key}psh>'
+   name: access_control_format
+ logs:
+ - filename: access_control
+   format: access_control_format
+   mode: ascii
 
 * X-Debug plugin added to ``plugin.config``
 
diff --git a/doc/developer-guide/cache-architecture/architecture.en.rst 
b/doc/developer-guide/cache-architecture/architecture.en.rst
index 0f04102..2bc3463 100644
--- a/doc/developer-guide/cache-architecture/architecture.en.rst
+++ b/doc/developer-guide/cache-architecture/architecture.en.rst
@@ -95,8 +95,8 @@ assigned to a stripe (and in turn to a cache volume) 
automatically based on a
 hash of the URI used to retrieve the object from the :term:`origin server`. It
 is possible to configure this to a limited extent in :file:`hosting.config`,
 which supports content from specific hosts or domain to be stored on specific
-cache volumes. As of version 4.0.1 it is also possible to control which cache
-spans (and hence, which cache stripes) are contained in a specific cache 
volume.
+cache volumes. It's also possible to control which cache spans (and hence,
+which cache stripes) are contained in a specific cache volume.
 
 The layout and structure of the cache spans, the cache volumes, and the cache
 stripes that compose them are derived entirely from :file:`storage.config` and
diff --git a/plugins/experimental/statichit/statichit.cc 
b/plugins/experimental/statichit/statichit.cc
index cc481df..1520350 100644
--- a/plugins/experimental/statichit/statichit.cc
+++ b/plugins/experimental/statichit/statichit.cc
@@ -1,6 +1,6 @@
 /** @file
 
-  Static HIt Content Serving
+  Static Hit Content Serving
 
   @section license License
 



[trafficserver] 01/02: Adds new plugin: statichit (#7173)

2020-09-28 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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

commit 4a566becdeb82bb33b3771ef0e2c3f8c68d6c68b
Author: Randall Meyer 
AuthorDate: Mon Sep 21 10:20:25 2020 -0700

Adds new plugin: statichit (#7173)

This is a simple plugin (based off of the `generator` plugin) to
serve static content from a local filesystem. It shares some
of the same functionality as the `healthchecks` plugin,
but can be used in the remap context, making it reloadable.

(cherry picked from commit e1585907bfec722c63e1bb200e1da1aff2bea585)
---
 plugins/Makefile.am |   1 +
 plugins/experimental/statichit/Makefile.inc |  20 +
 plugins/experimental/statichit/README.md|  38 ++
 plugins/experimental/statichit/statichit.cc | 637 
 4 files changed, 696 insertions(+)

diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 6cdb45d..4bf7678 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -81,6 +81,7 @@ include experimental/mp4/Makefile.inc
 include experimental/remap_stats/Makefile.inc
 include experimental/slice/Makefile.inc
 include experimental/sslheaders/Makefile.inc
+include experimental/statichit/Makefile.inc
 include experimental/stream_editor/Makefile.inc
 include experimental/system_stats/Makefile.inc
 include experimental/traffic_dump/Makefile.inc
diff --git a/plugins/experimental/statichit/Makefile.inc 
b/plugins/experimental/statichit/Makefile.inc
new file mode 100644
index 000..b45e5e0
--- /dev/null
+++ b/plugins/experimental/statichit/Makefile.inc
@@ -0,0 +1,20 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+pkglib_LTLIBRARIES += experimental/statichit/statichit.la
+
+experimental_statichit_statichit_la_SOURCES = \
+  experimental/statichit/statichit.cc
diff --git a/plugins/experimental/statichit/README.md 
b/plugins/experimental/statichit/README.md
new file mode 100644
index 000..cb7001d
--- /dev/null
+++ b/plugins/experimental/statichit/README.md
@@ -0,0 +1,38 @@
+This is a simple plugin to serve static content from a local filesystem. It 
shares some of the same functionality as the `healthchecks` plugin, but can be 
used in the remap context(thereby making it reloadable). It does not use 
fsnotify for watching the source files.
+
+If the file specified by the `--file-path` parameter is not found, the plugin 
will return the status code specified
+by the `--failure-code` parameter, defaulting to a 404. If the file is found, 
it will return the contents of the file
+setting the `Content-Type` header to the value specified on the `--mime-type` 
parameter.
+
+Metrics
+
+
+The plugin publishes the following metrics:
+
+statichit.response_bytes:
+  The total number of bytes emitted
+statichit.response_count:
+  The number of HTTP responses generated by the plugin
+
+Examples:
+---
+
+remap.config:
+```
+map /internal/healthcheck \
+   http://127.0.0.1 \
+   @plugin=statichit.so 
@pparam=--file-path=/var/run/trafficserver/healthcheck.txt \
+   @pparam=--mime-type=text/plain \
+   @pparam=--success-code=200 \
+   @pparam=--failure-code=403 \
+   @pparam=--max-age=0
+
+map http://content.example.com/content.txt \
+   http://127.0.0.1 \
+   @plugin=statichit.so 
@pparam=--file-path=/opt/ats/etc/trafficserver/static/content_source.txt \
+   @pparam=--failure-code=404 \
+   @pparam=--max-age=604800
+
+```
+
+NOTE: The remap origin is never contacted because this plugin intercepts the 
request and acts as the origin server. For that reason, the origin 
specification must be syntactically valid and resolvable in DNS.
diff --git a/plugins/experimental/statichit/statichit.cc 
b/plugins/experimental/statichit/statichit.cc
new file mode 100644
index 000..cc481df
--- /dev/null
+++ b/plugins/experimental/statichit/statichit.cc
@@ -0,0 +1,637 @@
+/** @file
+
+  Static HIt Content Serving
+
+  @section license License
+
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The 

[trafficserver] branch 9.0.x updated (8bc4d63 -> d6a5be1)

2020-09-28 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


from 8bc4d63  Follow redirection responses when refreshing stale cache 
objects. (#7213)
 new 4a566be  Adds new plugin: statichit (#7173)
 new d6a5be1  Docs cleanup (#7210)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doc/admin-guide/files/records.config.en.rst|   4 +-
 doc/admin-guide/plugins/access_control.en.rst  |  20 +-
 .../cache-architecture/architecture.en.rst |   4 +-
 plugins/Makefile.am|   1 +
 .../statichit}/Makefile.inc|   6 +-
 plugins/experimental/statichit/README.md   |  38 ++
 plugins/experimental/statichit/statichit.cc| 637 +
 7 files changed, 693 insertions(+), 17 deletions(-)
 copy plugins/{escalate => experimental/statichit}/Makefile.inc (84%)
 create mode 100644 plugins/experimental/statichit/README.md
 create mode 100644 plugins/experimental/statichit/statichit.cc



[trafficserver] branch 9.0.x updated: Follow redirection responses when refreshing stale cache objects. (#7213)

2020-09-28 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 8bc4d63  Follow redirection responses when refreshing stale cache 
objects. (#7213)
8bc4d63 is described below

commit 8bc4d63b624da172738310adf19446e45ebc2aca
Author: Walt Karas 
AuthorDate: Thu Sep 24 10:56:02 2020 -0500

Follow redirection responses when refreshing stale cache objects. (#7213)

(cherry picked from commit f3647619921ada5214b78d6ddb594a10fbc99a15)
---
 proxy/http/HttpSM.cc   |  2 +-
 proxy/http/HttpTransact.cc |  8 +-
 proxy/http/HttpTransact.h  |  1 +
 tests/gold_tests/redirect/gold/redirect_stale.gold | 10 +++
 tests/gold_tests/redirect/redirect_stale.test.py   | 95 ++
 5 files changed, 114 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 84dc4f4..9e853ea 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -8092,7 +8092,7 @@ inline bool
 HttpSM::is_redirect_required()
 {
   bool redirect_required = (enable_redirection && (redirection_tries <= 
t_state.txn_conf->number_of_redirections) &&
-
!HttpTransact::is_cache_hit(t_state.cache_lookup_result));
+
!HttpTransact::is_fresh_cache_hit(t_state.cache_lookup_result));
 
   SMDebug("http_redirect", "is_redirect_required %u", redirect_required);
 
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 7482f7a..7134cd1 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -7699,9 +7699,15 @@ HttpTransact::is_request_likely_cacheable(State *s, 
HTTPHdr *request)
 }
 
 bool
+HttpTransact::is_fresh_cache_hit(CacheLookupResult_t r)
+{
+  return (r == CACHE_LOOKUP_HIT_FRESH || r == CACHE_LOOKUP_HIT_WARNING);
+}
+
+bool
 HttpTransact::is_cache_hit(CacheLookupResult_t r)
 {
-  return (r == CACHE_LOOKUP_HIT_FRESH || r == CACHE_LOOKUP_HIT_WARNING || r == 
CACHE_LOOKUP_HIT_STALE);
+  return (is_fresh_cache_hit(r) || r == CACHE_LOOKUP_HIT_STALE);
 }
 
 void
diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h
index 9ae15e3..966bb7f 100644
--- a/proxy/http/HttpTransact.h
+++ b/proxy/http/HttpTransact.h
@@ -1038,6 +1038,7 @@ public:
   static bool will_this_request_self_loop(State *s);
   static bool is_request_likely_cacheable(State *s, HTTPHdr *request);
   static bool is_cache_hit(CacheLookupResult_t r);
+  static bool is_fresh_cache_hit(CacheLookupResult_t r);
 
   static void build_request(State *s, HTTPHdr *base_request, HTTPHdr 
*outgoing_request, HTTPVersion outgoing_version);
   static void build_response(State *s, HTTPHdr *base_response, HTTPHdr 
*outgoing_response, HTTPVersion outgoing_version,
diff --git a/tests/gold_tests/redirect/gold/redirect_stale.gold 
b/tests/gold_tests/redirect/gold/redirect_stale.gold
new file mode 100644
index 000..fe4f3b6
--- /dev/null
+++ b/tests/gold_tests/redirect/gold/redirect_stale.gold
@@ -0,0 +1,10 @@
+HTTP/1.1 200 OK
+X-Obj: obj2
+Cache-Control: max-age=2
+Content-Length: 0
+
+HTTP/1.1 200 OK
+X-Obj: obj2
+Cache-Control: max-age=2
+Content-Length: 0
+
diff --git a/tests/gold_tests/redirect/redirect_stale.test.py 
b/tests/gold_tests/redirect/redirect_stale.test.py
new file mode 100644
index 000..5ca975e
--- /dev/null
+++ b/tests/gold_tests/redirect/redirect_stale.test.py
@@ -0,0 +1,95 @@
+'''
+Test that redirects will be followed when refreshing stale cache objects.
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.Summary = '''
+Test that redirects will be followed when refreshing stale cache objects.
+'''
+
+server = Test.MakeOriginServer("server")
+
+ArbitraryTimestamp = '12345678'
+
+request_header = {
+'headers': ('GET /obj HTTP/1.1\r\n'
+'Host: *\r\n\r\n'),
+'timestamp': ArbitraryTimestamp,
+'body': ''}
+response_header = {
+'headers': ('HTTP/1.1 302 Found\r\n'
+'Location: 
http://127.0.0.1:{}/obj2\r\n\r\n'.format(server.Variables.Port)),
+'timestamp': 

[trafficserver] branch master updated (2e179c7 -> c23c5a4)

2020-09-28 Thread bneradt
This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


from 2e179c7  Introduce proxy-verifier to AuTests (#7211)
 add c23c5a4  Log config reload: use new config for initialization (#7215)

No new revisions were added by this update.

Summary of changes:
 proxy/logging/Log.cc  | 21 
 proxy/logging/Log.h   |  5 ++
 proxy/logging/LogBuffer.cc| 16 +++---
 proxy/logging/LogBuffer.h |  6 ++-
 proxy/logging/LogConfig.cc|  2 +-
 proxy/logging/LogObject.cc| 28 +--
 proxy/logging/LogObject.h | 18 +++
 proxy/logging/RolledLogDeleter.cc |  4 ++
 proxy/logging/YamlLogConfig.cc|  4 +-
 proxy/logging/unit-tests/test_RolledLogDeleter.cc |  4 +-
 tests/gold_tests/logging/log_retention.test.py| 60 +++
 11 files changed, 120 insertions(+), 48 deletions(-)