You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sh...@apache.org on 2019/09/03 13:56:40 UTC

[trafficserver] 02/02: address review comments

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

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

commit 8e4776c24e58e9bf41a6040a3aad71fd64e3a1ef
Author: Eric Schwartz <es...@gmail.com>
AuthorDate: Tue Aug 27 20:50:40 2019 +0000

    address review comments
---
 doc/admin-guide/logging/destinations.en.rst |  3 +++
 doc/admin-guide/logging/examples.en.rst     | 20 ++++++++++++++++++++
 proxy/logging/LogFile.cc                    |  4 ++++
 3 files changed, 27 insertions(+)

diff --git a/doc/admin-guide/logging/destinations.en.rst b/doc/admin-guide/logging/destinations.en.rst
index 5b70913..03b6f75 100644
--- a/doc/admin-guide/logging/destinations.en.rst
+++ b/doc/admin-guide/logging/destinations.en.rst
@@ -109,6 +109,9 @@ pipe, only full records are dropped.
 Output to named pipes is always, as the mode's name implies, in ASCII format.
 There is no option for logging binary format log data to a named pipe.
 
+For ASCII pipes there exists an option to set the ``pipe_buffer_size`` in
+the YAML config.
+
 .. _admin-logging-ascii-v-binary:
 
 Deciding Between ASCII or Binary Output
diff --git a/doc/admin-guide/logging/examples.en.rst b/doc/admin-guide/logging/examples.en.rst
index 4cca17e..f1d0840 100644
--- a/doc/admin-guide/logging/examples.en.rst
+++ b/doc/admin-guide/logging/examples.en.rst
@@ -299,6 +299,26 @@ for them to a UNIX pipe that the alerting software can constantly read from.
      - canaryfilter
      filename: alerting_canaries
 
+Configuring ASCII Pipe Buffer Size
+==================================
+
+This example mirrors the one above but also sets a ```pipe_buffer_size``` of
+1024 * 1024 for the pipe. This can be set on a per-pipe basis but is not 
+available on FreeBSD dists of ATS. If this field is not set, the pipe buffer
+will default to the OS default size.
+
+.. code:: yaml
+
+   logs:
+   - mode: pipe
+     format: canaryformat
+     filters:
+     - canaryfilter
+     filename: alerting_canaries
+     pipe_buffer_size: 1048576
+
+
+
 Summarizing Origin Responses by Hour
 ====================================
 
diff --git a/proxy/logging/LogFile.cc b/proxy/logging/LogFile.cc
index c9e911c..4154329 100644
--- a/proxy/logging/LogFile.cc
+++ b/proxy/logging/LogFile.cc
@@ -188,6 +188,9 @@ LogFile::open_file()
       return LOG_FILE_NO_PIPE_READERS;
     }
 
+#ifdef __FreeBSD__
+    // we don't do this for FreeBSD
+#else
     // adjust pipe size if necessary
     if (m_pipe_buffer_size) {
       long pipe_size = (long)fcntl(m_fd, F_GETPIPE_SZ);
@@ -209,6 +212,7 @@ LogFile::open_file()
         Debug("log-file", "NEW pipe size for pipe %s = %ld", m_name, pipe_size);
       }
     }
+#endif
   } else {
     if (m_log) {
       int status = m_log->open_file(Log::config->logfile_perm);