Skip to content

Commit

Permalink
Merge remote-tracking branch 'asf/9.0.x' into 9.0.x
Browse files Browse the repository at this point in the history
* asf/9.0.x:
  Updated ChangeLog
  Add virtual destructor to QUICTPConfig. (apache#7036)
  Squashed commit of the following: (apache#7000)
  Fix a compile warning
  add a null check to avoid crashing (apache#7035)
  Fix code to eliminate warning and enable feature (apache#7031)
  Fixed problem with all "forced" volumes cache (apache#7028)
  Added tasks and launch files for vscode, to configure, build and debug (apache#7005)
  slice: fix throttle not work (apache#7008)
  Extendible asan simple (apache#6650)
  Remove incorrect assert in inactivity timeout handling (apache#7012)
  Make MIOBufferWriter unit tests work when compiled without -DDEBUG.
  Disable tests using exceptions in MIOBufferWriter UT.
  Restore the MIOBufferWriter unit tests.
  Updated ChangeLog
  Updates to thread scale factor (apache#7007)
  Fixed core when sending back a redirect and having an invalid server response (apache#7004)
  • Loading branch information
zwoop committed Jul 23, 2020
2 parents 8c7b463 + 3b50340 commit 5af335d
Show file tree
Hide file tree
Showing 147 changed files with 9,765 additions and 3,429 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ rc/trafficserver.service

.svn/
.vscode/
target

tsxs

Expand Down
43 changes: 43 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) traffic_server",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/src/traffic_server/.libs/traffic_server",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "(gdb) traffic_manager",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/src/traffic_manager/.libs/traffic_manager",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
64 changes: 64 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Autoreconf",
"type": "shell",
"command": "autoreconf -if",
"problemMatcher": []
},
{
"label": "Configure",
"type": "shell",
"command": "./configure --prefix=${workspaceFolder}/target --enable-ccache --enable-experimental-plugins --enable-example-plugins --enable-test-tools --enable-debug --enable-werror ${env:ATS_VSCODE_CONFIGURE}",
"dependsOrder": "sequence",
"dependsOn": ["Autoreconf"],
"problemMatcher": []
},
{
"label": "Build",
"type": "shell",
"command": "make -j 16",
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Install",
"type": "shell",
"command": "make -j 16 install",
"problemMatcher": [
"$gcc"
]
},
{
"label": "Test",
"type": "shell",
"command": "make -j 8 test",
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Full Build",
"dependsOrder": "sequence",
"dependsOn": ["Configure", "Build", "Install"],
"problemMatcher": [
"$gcc"
]
}
{
"label": "Dump Enviroment Variables",
"command": "env",
"problemMatcher": []
}
]
}
14 changes: 14 additions & 0 deletions CHANGELOG-9.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ Changes with Apache Traffic Server 9.0.0
#6025 - Remove remnants of obsolete remap thread.
#6026 - Remove obsolete 4-2-0-fixup
#6031 - listen on all the net threads
#6032 - Restore the MIOBufferWriter unit tests.
#6037 - Promote 'Enable_Config_Var' from HttpConnectionCount to HttpConfig.
#6049 - set host name in TLS extension for SNI Host check in service side with sni policy verify_with_name_source.
#6053 - Enhance Connection Collapse in ATS core
Expand All @@ -700,6 +701,7 @@ Changes with Apache Traffic Server 9.0.0
#6070 - Updated API header and ssl_session_reuse for new TSSslSessionInsert changes
#6071 - Premature DSO unload with "suicidal" continuations
#6074 - Allow txn handler to be set from ssn on same hook
#6075 - Disable tests using exceptions in MIOBufferWriter UT.
#6076 - Issue 4635: Address pipe reuse after configuration reload issues
#6078 - Cleanup: Ignore checkprograms of remap
#6084 - Improving the messaging around the use of TSSslSessionGetBuffer
Expand All @@ -721,6 +723,7 @@ Changes with Apache Traffic Server 9.0.0
#6131 - Remove never implemented HttpTransact::service_transaction_in_proxy_only_mode
#6132 - Normalize loopback usage in session_match autest
#6134 - Removes the records.config.shadow alternative config file
#6137 - Make MIOBufferWriter unit tests work when compiled without -DDEBUG.
#6138 - tests: Adds autest for WebSocket mappings
#6139 - tests: fixes various python code issues found by pyflakes
#6140 - Remove using namespace std
Expand Down Expand Up @@ -848,6 +851,7 @@ Changes with Apache Traffic Server 9.0.0
#6486 - Issue 3546: Add "overridable" to the configuration variable description.
#6487 - Fix session reuse plugin shutdown crashes and cleanups
#6488 - Bikeshedding some code structures for reloadable plugins config
#6490 - Fix a compile warning
#6492 - Add null check to fix error tunnel crash
#6493 - Make all_headers test more resilient to timing
#6500 - traffic_dump: Make the client-request node gathered in a global hook
Expand Down Expand Up @@ -892,6 +896,7 @@ Changes with Apache Traffic Server 9.0.0
#6632 - Fixes a bug where the nexthop markNextHop method to mark a host down is not called.
#6642 - Fixes crash loading combined(cert+key) certs
#6645 - Traffic Dump: Adding an SNI filtering option.
#6650 - Extendible asan simple
#6655 - Fix origin scheme selection with partial-blind addition
#6656 - Check sni against SSL object
#6658 - Update TSStatFindName to check that sync callback is set on the stat
Expand Down Expand Up @@ -1004,3 +1009,12 @@ Changes with Apache Traffic Server 9.0.0
#6977 - Preserve cert name through ssl vc migration
#6984 - Fix out of source tree builds for QUIC
#6994 - Adds null check
#7000 - Add QUIC draft-27 support
#7004 - Fixed core when sending back a redirect and having an invalid server response
#7005 - Added tasks and launch files for vscode, to configure, build and debug
#7007 - Updates to thread scale factor
#7008 - slice plugin: fix throttle not work
#7012 - Remove incorrect assert in inactivity timeout handling
#7031 - Fix code to eliminate warning and enable feature
#7035 - Add a null check to avoid crashing
#7036 - Add virtual destructor to QUICTPConfig.
2 changes: 1 addition & 1 deletion configs/records.config.default.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# https://docs.trafficserver.apache.org/records.config#thread-variables
##############################################################################
CONFIG proxy.config.exec_thread.autoconfig INT 1
CONFIG proxy.config.exec_thread.autoconfig.scale FLOAT 1.5
CONFIG proxy.config.exec_thread.autoconfig.scale FLOAT 1.0
CONFIG proxy.config.exec_thread.limit INT 2
CONFIG proxy.config.accept_threads INT 1
CONFIG proxy.config.task_threads INT 2
Expand Down
21 changes: 17 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1261,18 +1261,31 @@ enable_quic=no
AC_MSG_CHECKING([whether APIs for QUIC are available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/ssl.h>]],
[[
#ifdef OPENSSL_IS_BORINGSSL
SSL_QUIC_METHOD var;
]])
],
[
AC_MSG_RESULT([yes])
enable_quic=yes
_quic_saved_LIBS=$LIBS
TS_ADDTO(LIBS, [$OPENSSL_LIBS])
AC_CHECK_FUNCS(SSL_set_quic_early_data_enabled)
LIBS=$_quic_saved_LIBS
],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/ssl.h>]],
[[
#ifdef SSL_MODE_QUIC_HACK
#else
#ifndef SSL_MODE_QUIC_HACK
# error no hack for quic
#endif
#endif
]])
],
[AC_MSG_RESULT([yes]); enable_quic=yes],
[AC_MSG_RESULT([yes]); enable_quic=yes; enable_quic_old_api=yes],
[AC_MSG_RESULT([no])])
])

AM_CONDITIONAL([ENABLE_QUIC], [test "x$enable_quic" = "xyes"])
AM_CONDITIONAL([ENABLE_QUIC_OLD_API], [test "x$enable_quic_old_api" = "xyes"])
TS_ARG_ENABLE_VAR([use], [quic])
AC_SUBST(use_quic)

Expand Down
10 changes: 8 additions & 2 deletions doc/admin-guide/files/records.config.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ Thread Variables
When enabled (the default, ``1``), |TS| scales threads according to the
available CPU cores. See the config option below.

.. ts:cv:: CONFIG proxy.config.exec_thread.autoconfig.scale FLOAT 1.5
.. ts:cv:: CONFIG proxy.config.exec_thread.autoconfig.scale FLOAT 1.0
Factor by which |TS| scales the number of threads. The multiplier is usually
the number of available CPU cores. By default this is scaling factor is
``1.5``.
``1.0``.

.. ts:cv:: CONFIG proxy.config.exec_thread.limit INT 2
Expand Down Expand Up @@ -3869,6 +3869,12 @@ QUIC Configuration
All configurations for QUIC are still experimental and may be changed or
removed in the future without prior notice.

.. ts:cv:: CONFIG proxy.config.quic.qlog_dir STRING NULL
:reloadable:

The qlog is enabled when this configuration is not NULL. And will dump
the qlog to this dir.

.. ts:cv:: CONFIG proxy.config.quic.instance_id INT 0
:reloadable:

Expand Down
2 changes: 1 addition & 1 deletion doc/admin-guide/performance/index.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ CPU and Thread Optimization
Thread Scaling
~~~~~~~~~~~~~~

By default, |TS| creates 1.5 threads per CPU core on the host system. This may
By default, |TS| creates one thread per CPU core on the host system. This may
be adjusted with the following settings in :file:`records.config`:

* :ts:cv:`proxy.config.exec_thread.autoconfig`
Expand Down
32 changes: 17 additions & 15 deletions doc/developer-guide/internal-libraries/Extendible.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,19 @@ the type's constructor, destructor, and serializer. And to avoid corruption, the
}
When an derived class is instantiated, :func:`template<> alloc()` will allocate a block of memory for the derived class and all added
fields. The only memory overhead per instance is an uint16 used as a offset to the start of the extendible block.
When an derived class is instantiated, :func:`template<> create()` will allocate a block of memory for the derived class and all added
fields. The only memory overhead per instance is an uint16 used as a offset to the start of the extendible block. Then the constructor of the class
is called, followed by the constructors of each extendible field.

.. code-block:: cpp
ExtendibleExample* alloc_example() {
return ext::alloc<ExtendibleExample>();
return ext::create<ExtendibleExample>();
}
Memory Layout
-------------
One block of memory is allocated per |Extendible|, which included all member variables and extended fields.
One block of memory is allocated per |Extendible|, which include all member variables and extended fields.
Within the block, memory is arranged in the following order:

#. Derived members (+padding align next field)
Expand Down Expand Up @@ -129,8 +130,8 @@ which simplifies the code using it. Also this provides compile errors for common
}
PluginFunc() {
Food *banana = ext::alloc<Food>();
Car *camry = ext::alloc<Car>();
Food *banana = ext::create<Food>();
Car *camry = ext::create<Car>();
// Common user errors
Expand All @@ -140,11 +141,11 @@ which simplifies the code using it. Also this provides compile errors for common
float speed = ext::get(banana,fld_max_speed);
// ^^^^^^^^^^^^^
// Compile error: Cannot downcast banana to type Extendible<Car>
// Compile error: Cannot convert banana to type Extendible<Car>
float weight = ext::get(camry,fld_food_weight);
// ^^^^^^^^^^^^^^^
// Compile error: Cannot downcast camry to type Extendible<Food>, even though Car and Food each have a 'weight' field, the FieldId is strongly typed.
// Compile error: Cannot convert camry to type Extendible<Food>, even though Car and Food each have a 'weight' field, the FieldId is strongly typed.
}
Expand All @@ -157,20 +158,20 @@ which simplifies the code using it. Also this provides compile errors for common
Fruit.schema.addField(fld_has_seeds, "has_seeds");
Fruit mango = ext::alloc<Fruit>();
Fruit mango = ext::create<Fruit>();
ext::set(mango, fld_has_seeds) = true; // downcasts mango to Extendible<Fruit>
ext::set(mango, fld_food_weight) = 2; // downcasts mango to Extendible<Food>
ext::set(mango, fld_has_seeds) = true; // converts mango to Extendible<Fruit>
ext::set(mango, fld_food_weight) = 2; // converts mango to Extendible<Food>
ext::set(mango, fld_max_speed) = 9;
// ^^^^^^^^^^^^^
// Compile error: Cannot downcast mango to type Extendible<Car>
// Compile error: Cannot convert mango to type Extendible<Car>
Inheritance
-----------

Unfortunately it is non-trivial handle multiple |Extendible| super types in the same inheritance tree.
:func:`template<> alloc()` handles allocation and initialization of the entire `Derived` class, but it is dependent on each class defining :code:`using super_type = *some_super_class*;` so that it recurse through the classes.
:func:`template<> create()` handles allocation and initialization of the entire `Derived` class, but it is dependent on each class defining :code:`using super_type = *some_super_class*;` so that it recurse through the classes.

.. code-block:: cpp
Expand All @@ -191,7 +192,7 @@ Inheritance
ext::FieldId<A, atomic<uint16_t>> ext_a_1;
ext::FieldId<C, uint16_t> ext_c_1;
C &x = *(ext::alloc<C>());
C &x = *(ext::create<C>());
ext::viewFormat(x);
:func:`viewFormat` prints a diagram of the position and size of bytes used within the allocated
Expand Down Expand Up @@ -235,8 +236,9 @@ Namespace `ext`

one schema instance per |Extendible| to define contained |FieldDesc|

.. function:: template<typename Derived_t> Extendible* alloc()
.. function:: template<typename Derived_t> Extendible* create()

To be used in place of `new Derived_t()`.
Allocate a block of memory. Construct the base data.
Recursively construct and initialize `Derived_t::super_type` and its |Extendible| classes.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ msgstr ""

#: ../../../admin-guide/performance/index.en.rst:185
msgid ""
"By default, |TS| creates 1.5 threads per CPU core on the host system. This "
"By default, |TS| creates one thread per CPU core on the host system. This "
"may be adjusted with the following settings in :file:`records.config`:"
msgstr ""

Expand Down

0 comments on commit 5af335d

Please sign in to comment.