You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bn...@apache.org on 2022/09/28 00:56:01 UTC

[trafficserver] 01/01: Merge latest master into 10-Dev

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

bneradt pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 6d9652e7dfe10311c51374c389ea8d01c8c835bb
Merge: d76342bd9 42bc196d0
Author: Brian Neradt <br...@gmail.com>
AuthorDate: Wed Sep 28 00:55:02 2022 +0000

    Merge latest master into 10-Dev
    
    Conflicts:
          README
          iocore/hostdb/HostDB.cc
          iocore/net/UnixUDPNet.cc

 Makefile.am                                        |   2 +
 README                                             | 250 ------------------
 README.md                                          | 284 +++++++++++++++++++++
 doc/admin-guide/files/records.config.en.rst        |  15 ++
 doc/admin-guide/logging/understanding.en.rst       |  17 ++
 include/tscore/Ptr.h                               |   2 +
 {plugins/xdebug => include/tscpp/api}/Cleanup.h    |   0
 include/tscpp/api/Makefile.am                      |   1 +
 include/tscpp/util/Strerror.h                      |  34 ++-
 iocore/cache/Cache.cc                              |   5 -
 iocore/cache/Store.cc                              |   9 +-
 iocore/dns/DNS.cc                                  |  55 ++--
 iocore/dns/DNSConnection.cc                        |  12 +-
 iocore/eventsystem/I_SocketManager.h               | 144 +++++------
 iocore/eventsystem/SocketManager.cc                |   9 -
 iocore/hostdb/HostDB.cc                            | 186 ++------------
 iocore/hostdb/HostDBInfo.cc                        |  84 ++++++
 iocore/hostdb/HostFile.cc                          | 150 +++++++++++
 iocore/hostdb/HostFile.h                           |  51 ++++
 iocore/hostdb/Makefile.am                          |  23 +-
 iocore/hostdb/P_HostDBProcessor.h                  |  25 +-
 iocore/hostdb/P_RefCountCache.h                    |   6 +-
 iocore/hostdb/P_RefCountCacheSerializer.h          |  22 +-
 iocore/hostdb/test_HostFile.cc                     | 164 ++++++++++++
 iocore/net/BIO_fastopen.cc                         |   6 +-
 iocore/net/Connection.cc                           |  18 +-
 iocore/net/P_SSLConfig.h                           |   2 +-
 iocore/net/SSLConfig.cc                            |   2 +-
 iocore/net/SSLNetVConnection.cc                    |  23 +-
 iocore/net/UnixConnection.cc                       |  12 +-
 iocore/net/UnixNetAccept.cc                        |  12 +-
 iocore/net/UnixNetVConnection.cc                   |  10 +-
 iocore/net/UnixUDPConnection.cc                    |   2 +-
 iocore/net/UnixUDPNet.cc                           |  32 +--
 mgmt/RecordsConfig.cc                              |   2 +
 plugins/s3_auth/s3_auth.cc                         |  41 +--
 plugins/xdebug/Makefile.inc                        |   1 -
 plugins/xdebug/xdebug.cc                           |   2 +-
 proxy/PluginVC.cc                                  | 240 ++++++-----------
 proxy/PluginVC.h                                   |  10 +-
 proxy/hdrs/HTTP.cc                                 |  37 +++
 proxy/hdrs/HTTP.h                                  |   1 +
 proxy/hdrs/URL.cc                                  |  15 ++
 proxy/hdrs/URL.h                                   |  11 +-
 proxy/hdrs/unit_tests/test_Hdrs.cc                 |   4 +-
 proxy/http/HttpSM.cc                               |   2 +-
 proxy/http/HttpTransactHeaders.cc                  |   9 +-
 proxy/http/remap/RemapConfig.cc                    |   2 +-
 proxy/logging/LogBuffer.cc                         |  34 ++-
 proxy/logging/LogBuffer.h                          |   2 +
 proxy/logging/LogConfig.cc                         |   6 +
 proxy/logging/LogConfig.h                          |   1 +
 proxy/logging/LogObject.cc                         | 127 +++++++--
 proxy/logging/LogObject.h                          |   7 +-
 proxy/logging/YamlLogConfig.cc                     |  10 +-
 proxy/logging/unit-tests/benchmark_LogObject.cc    | 197 ++++++++++++++
 rc/trafficserver.in                                |   8 -
 src/traffic_cache_tool/CacheDefs.cc                |   2 -
 src/traffic_server/traffic_server.cc               |  14 +-
 src/tscpp/util/Makefile.am                         |   1 +
 src/tscpp/util/unit_tests/test_Strerror.cc         |  33 +++
 tests/gold_tests/cache/cache-control.test.py       |  22 ++
 .../cache/replay/cache-control-pragma.replay.yaml  | 218 ++++++++++++++++
 .../per_server_connection_max.test.py              |  74 ++++++
 .../origin_connection/slow_servers.replay.yaml     | 166 ++++++++++++
 .../pluginTest/s3_auth/gold/s3_auth_parsing.gold   |  17 ++
 .../s3_auth/gold/s3_auth_parsing_ts.gold           |   5 +
 .../s3_auth/rules/v4-parse-test.test_input         |  29 +++
 .../pluginTest/s3_auth/s3_auth_config.test.py      |  66 +++++
 tests/gold_tests/tls/ssl-post.c                    |   4 -
 tests/prepare_proxy_verifier.sh                    |   2 +-
 tests/proxy-verifier-version.txt                   |   2 +-
 tools/build_h3_tools.sh                            |  38 ++-
 tools/gdb-helpers.py                               | 263 +++++++++++++++++++
 74 files changed, 2497 insertions(+), 897 deletions(-)

diff --cc README.md
index 000000000,9d18f47d5..1827ff407
mode 000000,100644..100644
--- a/README.md
+++ b/README.md
@@@ -1,0 -1,285 +1,284 @@@
+ # Apache Traffic Server
+ 
+ [![Jenkins](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.trafficserver.apache.org%2Fjob%2Fmaster%2Fjob%2Fos-centos_7%2F&label=CentOS%207)](https://ci.trafficserver.apache.org/job/master/job/os-centos_7/)
+ [![Jenkins](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.trafficserver.apache.org%2Fjob%2Fmaster%2Fjob%2Fos-debian_10%2F&label=Debian%2010)](https://ci.trafficserver.apache.org/job/master/job/os-debian_10/)
+ [![Jenkins](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.trafficserver.apache.org%2Fjob%2Fmaster%2Fjob%2Fos-debian_11%2F&label=Debian%2011)](https://ci.trafficserver.apache.org/job/master/job/os-debian_11/)
+ [![Jenkins](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.trafficserver.apache.org%2Fjob%2Fmaster%2Fjob%2Fos-fedora_35%2F&label=Fedora%2035)](https://ci.trafficserver.apache.org/job/master/job/os-fedora_35/)
+ [![Jenkins](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.trafficserver.apache.org%2Fjob%2Fmaster%2Fjob%2Fos-fedora_36%2F&label=Fedora%2036)](https://ci.trafficserver.apache.org/job/master/job/os-fedora_36/)
+ [![Jenkins](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.trafficserver.apache.org%2Fjob%2Fmaster%2Fjob%2Ffreebsd%2F&label=FreeBSD)](https://ci.trafficserver.apache.org/job/master/job/freebsd/)
+ [![Jenkins](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.trafficserver.apache.org%2Fjob%2Fmaster%2Fjob%2Fosx%2F&label=macOS)](https://ci.trafficserver.apache.org/job/master/job/osx/)
+ [![Jenkins](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.trafficserver.apache.org%2Fjob%2Fmaster%2Fjob%2Fos-rockylinux_8%2F&label=Rocky%20Linux%208)](https://ci.trafficserver.apache.org/job/master/job/os-rockylinux_8/)
+ [![Jenkins](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.trafficserver.apache.org%2Fjob%2Fmaster%2Fjob%2Fos-ubuntu_20.04%2F&label=Ubuntu%2020.04)](https://ci.trafficserver.apache.org/job/master/job/os-ubuntu_20.04/)
+ [![Jenkins](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.trafficserver.apache.org%2Fjob%2Fmaster%2Fjob%2Fos-ubuntu_21.04%2F&label=Ubuntu%2021.04)](https://ci.trafficserver.apache.org/job/master/job/os-ubuntu_21.04/)
+ [![Jenkins](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.trafficserver.apache.org%2Fjob%2Fmaster%2Fjob%2Fos-ubuntu_22.04%2F&label=Ubuntu%2022.04)](https://ci.trafficserver.apache.org/job/master/job/os-ubuntu_22.04/)
+ 
+ Traffic Server is a high-performance building block for cloud services.
+ It's more than just a caching proxy server; it also has support for
+ plugins to build large scale web applications.
+ 
+ ## DIRECTORY STRUCTURE
+ ```
+ trafficserver ............. Top src dir
+ ├── build ................. Custom macros for configure.ac
+ ├── ci .................... Quality assurance and other CI tools and configs
+ ├── configs ............... Configurations
+ ├── contrib ............... Various contributed auxiliary pieces
+ ├── doc ................... Documentation for Traffic Server
+ │   ├── admin-guide ....... Admin guide documentations
+ │   ├── appendices ........ Appendices of Traffic Server
+ │   ├── developer-guide ... Documentation for developers
+ │   ├── dot ............... Graphviz source files for docs pictures
+ │   ├── static ............ Static resources
+ │   └── uml ............... Documentation in UML
+ ├── example ............... Example plugins
+ ├── iocore ................
+ │   ├── aio ............... Asynchronous I/O core
+ │   ├── cache ............. Disk and RAM cache
+ │   ├── dns ............... DNS (asynchronous)
+ │   ├── eventsystem ....... Event Driven Engine
+ │   ├── hostdb ............ Internal DNS cache
+ │   ├── net ............... Network
+ │   │   └── quic .......... QUIC implementation
+ │   └── utils ............. Utilities
+ ├── lib ...................
 -│   ├── perl .............. Perl libraries for e.g. mgmt access and configurations
++│   ├── perl .............. Perl libraries for configurations
+ │   ├── records ........... Library for config files
+ │   └── yamlcpp ........... Library for YAML of C++
 -├── mgmt .................. Management server and tools
++├── mgmt .................. JSONRPC server/management and tools
+ ├── plugins ............... Stable core plugins
+ │   └── experimental ...... Experimental core plugins
+ ├── proxy ................. HTTP proxy logic
+ │   ├── hdrs .............. Headers parsing and management
+ │   ├── http .............. The actual HTTP protocol implementation
+ │   ├── http2 ............. HTTP/2 implementation
+ │   ├── http3 ............. HTTP/3 implementation
+ │   ├── logging ........... Flexible logging
+ │   └── shared ............ Shared files
+ ├── rc .................... Installation programs and scripts
+ ├── src ................... Source for all the main binaries / applications
+ │   ├── traffic_cache_tool  Tool to interact with the Traffic Server cache
+ │   ├── traffic_crashlog .. Helper process that catches Traffic Server crashes
+ │   ├── traffic_ctl ....... Command line management tool
+ │   ├── traffic_layout .... Display information on the build and runtime directory structure
+ │   ├── traffic_logcat .... Convert binary log file to plain text
+ │   ├── traffic_logstats .. Log parsing and metrics calculation utility
 -│   ├── traffic_manager ... The manager process for Traffic Server
+ │   ├── traffic_server .... Main proxy server
+ │   ├── traffic_top ....... Top like tool for viewing Traffic Server statistics
+ │   ├── traffic_via ....... Tool for decoding the Traffic Server Via header codes
+ │   ├── traffic_wccp ...... Program speaking the client side of the WCCP
+ │   ├── tscore ............ Base / core library
+ │   ├── tscpp ............. C++ api wrapper for plugin developers
+ │   └── wccp .............. WCCP implementation
+ ├── tests ................. Different tests for Traffic Server
+ ├── tools ................. Directory of various tools
+ ├── INSTALL ............... Build and installation guide
+ ├── LAYOUT ................ Traffic Server default layout
+ ├── LICENSE ............... Full license text
+ ├── NOTICE ................ Copyright notices
+ ├── README ................ Intro, links, build info
+ ├── README-EC2 ............ Info on EC2 support
+ ├── REVIEWERS ............. (Incomplete) list of areas with committer interest
+ └── STATUS ................ Release history and information
+ ```
+ ## REQUIREMENTS
+ 
+   This section outlines build requirements for different OS
+   distributions. This may be out of date compared to the on-line
+   requirements at
+ 
+   <https://cwiki.apache.org/confluence/display/TS/Building>.
+ 
+   As of ATS v7.0.0 and later, gcc 4.8.1 or later is required, since we now use
+   and require the C++11 standard.
+ 
+ ### Fedora / CentOS / RHEL:
+ ```
+ autoconf
+ automake
+ libtool
+ pkgconfig
+ perl-ExtUtils-MakeMaker
+ gcc/g++ or clang/clang++
+ openssl-devel
+ pcre-devel
+ ncurses-devel and libcurl-devel(optional, needed for traffic_top)
+ libcap-devel (optional, highly recommended)
+ hwloc-devel (optional, highly recommended)
+ flex (optional, needed for e.g. WCCP)
+ ```
+ 
+ ### Ubuntu / Debian
+ ```
+ autoconf
+ automake
+ libtool
+ pkg-config
+ libmodule-install-perl
+ gcc/g++ or clang/clang++
+ zlib1g-dev
+ libssl-dev
+ libpcre3-dev
+ libcap-dev (optional, highly recommended)
+ libhwloc-dev (optional, highly recommended)
+ libncurses5-dev (optional, required for e.g.: traffic_top)
+ libcurl4-openssl-dev (optional, required for e.g.: traffic_top)
+ flex (optional, required for e.g. WCCP)
+ ```
+ 
+ ### Alpine Linux
+ ```
+ build-base
+ libexecinfo-dev
+ pcre-dev
+ libressl-dev
+ autoconf
+ automake
+ libtool
+ linux-headers
+ ```
+ 
+ ### macOS (we recommend HomeBrew):
+ ```
+ autoconf
+ automake
+ pkg-config
+ libtool
+ openssl
+ pcre
+ ```
+ 
+ ### FreeBSD
+ ```
+ devel/gmake
+ devel/autoconf
+ devel/automake
+ devel/pkgconf
+ devel/libtool
+ security/openssl
+ devel/pcre
+ textproc/flex (optional, install newer version from ports, fix PATH)
+ devel/hwloc (optional, highly recommended)
+ ```
+ 
+ ### OmniOS:
+ ```
+ developer/gcc46
+ developer/build/gnu-make
+ developer/build/autoconf
+ developer/build/automake-111
+ developer/build/libtool
+ library/security/openssl
+ library/pcre
+ ```
+ 
+ ## Building from distribution
+ 
+ You can download the latest source code from the official Apache Traffic
+ Server site:
+ 
+ [https://trafficserver.apache.org/downloads](https://trafficserver.apache.org/downloads)
+ 
+ (or via the URL shortener: http://s.apache.org/uG). Once downloaded,
+ follow the instructions:
+ 
+ ```
+ tar jxvf trafficserver-9.1.3.tar.bz2
+ cd trafficserver-9.1.3
+ ./configure            # configure the build environment to create Makefiles
+ make                   # execute the compile
+ ```
+ 
+ This will build with a destination prefix of /usr/local. You can finish
+ the installation with
+ 
+ ```
+ sudo make install
+ ```
+ 
+ 
+ ## BUILDING FROM GIT REPO
+ 
+ ```
+ git clone https://github.com/apache/trafficserver.git   # get the source code from ASF Git repository
+ cd trafficserver                                        # enter the checkout directory
+ autoreconf -if                                          # generate the configure script and Makefile.in files
+ ./configure                                             # configure the build environment to create Makefiles
+ make                                                    # execute the compile
+ ```
+ 
+ ## Instructions for building on EC2
+ NOTE: Alternately you may use the scripts under 'contrib' which will automate the install for trafficserver under EC2 which is HIGHLY RECOMMENDED. See 'README-EC2' for further details.
+ 
+ ### As root do the following when using Ubuntu
+ ```
+ mkdir -p /mnt          #EC2 Storage Mount, where storage is located
+ cd /mnt
+ git clone ...          # get the source code from ASF Git repo
+ cd trafficserver       # enter the checkout dir
+ autoreconf -i --force  # generate the configure script and Makefile.in files
+ ./configure
+ make
+ ```
+ 
+ ### As root do the following when using Fedora Core 8 kernel
+ ```
+ mkdir -p /mnt          #EC2 Storage Mount, where storage is located
+ cd /mnt
+ git clone ...          # get the source code from ASF Git repo
+ cd trafficserver       # enter the checkout dir
+ autoreconf -i --force  # generate the configure script and Makefile.in files
+ ./configure --disable-eventfd
+ make
+ ```
+ 
+ ### Instructions for building on FreeBSD
+ 
+ The only difference is how to run configure and make:
+ ```
+ MAKE=gmake ./configure # make sure that gmake is the make we use
+ gmake
+ ```
+ 
+ ## INSTALLATION
+ 
+ ```
+ /usr/local
+ ├── /var/log/trafficserver   log files created at runtime
+ ├── /var/trafficserver       runtime files
+ ├── /etc/trafficserver       configuration files
+ ├── /bin                     executable binaries
+ └── /libexec/trafficserver   plugins
+ ```
+ 
+ ## CRYPTO NOTICE
+ 
+ This distribution includes cryptographic software.  The country in
+ which you currently reside may have restrictions on the import,
+ possession, use, and/or re-export to another country, of
+ encryption software.  BEFORE using any encryption software, please
+ check your country's laws, regulations and policies concerning the
+ import, possession, or use, and re-export of encryption software, to
+ see if this is permitted.  See <http://www.wassenaar.org/> for more
+ information.
+ 
+ The U.S. Government Department of Commerce, Bureau of Industry and
+ Security (BIS), has classified this software as Export Commodity
+ Control Number (ECCN) 5D002.C.1, which includes information security
+ software using or performing cryptographic functions with asymmetric
+ algorithms.  The form and manner of this Apache Software Foundation
+ distribution makes it eligible for export under the License Exception
+ ENC Technology Software Unrestricted (TSU) exception (see the BIS
+ Export Administration Regulations, Section 740.13) for both object
+ code and source code.
+ 
+ The following provides more details on the included cryptographic
+ software:
+ 
+ > The functionality of OpenSSL <http://www.openssl.org/> is
+ > utilized in parts of the software.
+ 
+ ## ADDITIONAL INFO
+ 
+ - Web page: https://trafficserver.apache.org/
+ - Wiki: https://cwiki.apache.org/confluence/display/TS/
+ - User mailing list: users@trafficserver.apache.org
diff --cc iocore/hostdb/HostDB.cc
index 40b8c0709,79c55bff2..16dcb4af6
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@@ -29,7 -29,7 +29,8 @@@
  #include "tscore/ts_file.h"
  #include "tscore/ink_apidefs.h"
  #include "tscore/bwf_std_format.h"
 +#include "MgmtDefs.h" // MgmtInt, MgmtFloat, etc
+ #include "HostFile.h"
  
  #include <utility>
  #include <vector>
diff --cc iocore/net/UnixUDPNet.cc
index b211bc59c,04ea78997..633e70a59
--- a/iocore/net/UnixUDPNet.cc
+++ b/iocore/net/UnixUDPNet.cc
@@@ -815,19 -806,7 +815,19 @@@ UDPNetProcessor::UDPBind(Continuation *
      goto Lerror;
    }
  
 +  if (safe_setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, SOCKOPT_ON, sizeof(int)) < 0) {
 +    Debug("udpnet", "setsockopt for SO_REUSEPORT failed");
 +    goto Lerror;
 +  }
 +
 +#ifdef SO_REUSEPORT_LB
 +  if (safe_setsockopt(fd, SOL_SOCKET, SO_REUSEPORT_LB, SOCKOPT_ON, sizeof(int)) < 0) {
 +    Debug("udpnet", "setsockopt for SO_REUSEPORT_LB failed");
 +    goto Lerror;
 +  }
 +#endif
 +
-   if (need_bind && (socketManager.ink_bind(fd, addr, ats_ip_size(addr)) < 0)) {
+   if (need_bind && (SocketManager::ink_bind(fd, addr, ats_ip_size(addr)) < 0)) {
      Debug("udpnet", "ink_bind failed");
      goto Lerror;
    }
diff --cc rc/trafficserver.in
index 02b325bbf,dc0093ba2..09d037eb1
--- a/rc/trafficserver.in
+++ b/rc/trafficserver.in
@@@ -466,15 -482,11 +466,7 @@@ case "$1" i
              status=$?
              [ $status -eq 0 ] || /bin/echo -n "not "
              echo "running."
- <<<<<<< HEAD
          elif [ "$DISTRIB_ID" = "FreeBSD" -o "$DISTRIB_ID" = "gentoo" -o "$DISTRIB_ID" = "nixos" ]; then
--            if pgrep $TM_NAME > /dev/null ; then
--                echo "$TM_NAME running as pid `cat $TM_PIDFILE`" ; else
--                echo "$TM_NAME not running"
--            fi
- =======
-         elif [ "$DISTRIB_ID" = "FreeBSD" -o "$DISTRIB_ID" = "gentoo" ]; then
- >>>>>>> 24778a1... JSONRPC - Adapt rc/* files to work with TS instead of TM
              if pgrep $TS_NAME > /dev/null ; then
                  echo "$TS_NAME running as pid `cat $TS_PIDFILE`"; else
                  echo "$TS_NAME not running"