Skip to content

Commit dad9c30

Browse files
committed
Change non-boolean enabled configs to mode
Most "enabled" configurations are booleans that toggle on or off a feature. But we have a few that are named "enabled" but actually take an enumeration of values to control behavior. This is confusing terminology. This patch keeps support for the enabled configuration as currently named, adds a new "mode" configuration for these, and deprecates the old "enabled" config in the docs. proxy.config.ssl.session_cache.enabled was somewhat complicated: with the 10.0.0 release, we implemented it as "value" to try to address the issue of this patch just for that parameter, but kept the "enabled" config description in the docs. So the docs were out of sync with the code. This adds support for "enabled" and immediately deprecates that, since users may have tried to use that, silently keeps support for "value" in case that was used, and adds the now desired "mode" configuration. If a user passes both the deprecated "enabled" config as well as the new "mode" config, then they must be the same value, otherwise an Emergency message is logged because it is impossible for ATS to discern which value should be used. Aside from this Emergency log on mismatch just mentioned, this patch should be backwards compatible without introducing any changes in behavior for current configs. Fixes: #11901
1 parent 447a2a0 commit dad9c30

File tree

358 files changed

+943
-511
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

358 files changed

+943
-511
lines changed

contrib/set_trafficserver.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function recordsConfig() {
4646
traffic_ctl config set proxy.config.exec_thread.autoconfig.scale 1.000000
4747

4848
traffic_ctl config set proxy.config.accept_threads 1
49-
traffic_ctl config set proxy.config.log.logging_enabled 0
49+
traffic_ctl config set proxy.config.log.logging.mode 0
5050
traffic_ctl config set proxy.config.http.server_port 8080
5151
traffic_ctl config set proxy.config.url_remap.pristine_host_hdr 1
5252

doc/admin-guide/files/logging.yaml.en.rst

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,11 @@ filename string The name of the logfile relative to the defau
289289
format string a string with a valid named format specification.
290290
header string If present, emitted as the first line of each
291291
new log file.
292-
rolling_enabled *see below* Determines the type of log rolling to use (or
292+
rolling_mode *see below* Determines the type of log rolling to use (or
293+
whether to disable rolling). Overrides
294+
:ts:cv:`proxy.config.log.rolling.mode`.
295+
rolling_enabled *see below* **Deprecated in 10.1.0**. Use ``rolling_mode``
296+
instead. Determines the type of log rolling to use (or
293297
whether to disable rolling). Overrides
294298
:ts:cv:`proxy.config.log.rolling_enabled`.
295299
rolling_interval_sec number Interval in seconds between log file rolling.
@@ -310,12 +314,17 @@ filters array of The optional list of filter objects which
310314
====================== =========== =================================================
311315

312316
Enabling log rolling may be done globally in :file:`records.yaml`, or on a
313-
per-log basis by passing appropriate values for the ``rolling_enabled`` key. The
317+
per-log basis by passing appropriate values for the ``rolling_mode`` key. The
314318
latter method may also be used to effect different rolling settings for
315319
individual logs. The numeric values that may be passed are the same as used by
316-
:ts:cv:`proxy.config.log.rolling_enabled`. For convenience and readability,
320+
:ts:cv:`proxy.config.log.rolling.mode`. For convenience and readability,
317321
the following predefined variables may also be used in :file:`logging.yaml`:
318322

323+
.. deprecated:: 10.1.0
324+
325+
The ``rolling_enabled`` parameter is deprecated. Use ``rolling_mode`` instead.
326+
``rolling_enabled`` will continue to work for backwards compatibility.
327+
319328
log.roll.none
320329
Disable log rolling.
321330

@@ -389,3 +398,18 @@ matched the REFRESH_HIT filter we created.
389398
format: summaryfmt
390399
filters:
391400
- refreshhitfilter
401+
402+
The following is an example of a log specification that creates a rolling log
403+
that rolls every hour when the size reaches 100MB. This shows the new ``rolling_mode``
404+
parameter (recommended) which replaces the deprecated ``rolling_enabled`` parameter.
405+
Mode 4 combines both time and size rolling triggers.
406+
407+
.. code:: yaml
408+
409+
logs:
410+
- mode: ascii
411+
filename: combined_rolling
412+
format: minimalfmt
413+
rolling_mode: 4 # Roll on time when size reached
414+
rolling_interval_sec: 3600 # Check every hour
415+
rolling_size_mb: 100 # Roll when 100MB is reached

doc/admin-guide/files/records.yaml.en.rst

Lines changed: 188 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,29 @@ System Variables
320320

321321
.. ts:cv:: CONFIG proxy.config.output.logfile.rolling_enabled INT 0
322322
:reloadable:
323+
:deprecated:
324+
325+
.. deprecated:: 10.1.0
326+
327+
This configuration is deprecated. Use :ts:cv:`proxy.config.output.logfile.rolling.mode` instead.
328+
329+
Specifies how the output log is rolled. You can specify the following values:
330+
331+
===== ======================================================================
332+
Value Description
333+
===== ======================================================================
334+
``0`` Disables output log rolling.
335+
``1`` Enables output log rolling at specific intervals (specified with the
336+
:ts:cv:`proxy.config.output.logfile.rolling_interval_sec` variable).
337+
The clock starts ticking on |TS| boot.
338+
``2`` Enables output log rolling when the output log reaches a specific size
339+
(specified with :ts:cv:`proxy.config.output.logfile.rolling_size_mb`).
340+
``3`` Enables output log rolling at specific intervals or when the output log
341+
reaches a specific size (whichever occurs first).
342+
===== ======================================================================
343+
344+
.. ts:cv:: CONFIG proxy.config.output.logfile.rolling.mode INT 0
345+
:reloadable:
323346

324347
Specifies how the output log is rolled. You can specify the following values:
325348

@@ -443,6 +466,35 @@ Thread Variables
443466
that :program:`traffic_server` crashes. ``-1`` means there is
444467
no limit. A value of ``0`` prevents core dump creation.
445468

469+
.. ts:cv:: CONFIG proxy.config.mlock_enabled INT 0
470+
:deprecated:
471+
472+
.. deprecated:: 10.1.0
473+
474+
This configuration is deprecated. Use :ts:cv:`proxy.config.mlock.mode` instead.
475+
476+
Controls memory locking behavior for Traffic Server:
477+
478+
===== ======================================================================
479+
Value Description
480+
===== ======================================================================
481+
``0`` Disabled - no memory locking.
482+
``1`` Enabled for important pages (e.g. cache directory).
483+
``2`` Enabled for all pages.
484+
===== ======================================================================
485+
486+
.. ts:cv:: CONFIG proxy.config.mlock.mode INT 0
487+
488+
Controls memory locking behavior for Traffic Server:
489+
490+
===== ======================================================================
491+
Value Description
492+
===== ======================================================================
493+
``0`` No memory locking.
494+
``1`` Memory locking enabled for important pages (e.g. cache directory).
495+
``2`` Memory locking enabled for all pages.
496+
===== ======================================================================
497+
446498
.. ts:cv:: CONFIG proxy.config.restart.stop_listening INT 0
447499
:reloadable:
448500

@@ -967,6 +1019,11 @@ allow-plain
9671019
.. ts:cv:: CONFIG proxy.config.http.response_server_enabled INT 1
9681020
:reloadable:
9691021
:overridable:
1022+
:deprecated:
1023+
1024+
.. deprecated:: 10.1.0
1025+
1026+
This configuration is deprecated. Use :ts:cv:`proxy.config.http.response_server.mode` instead.
9701027

9711028
You can specify one of the following:
9721029

@@ -980,6 +1037,22 @@ allow-plain
9801037
not have one already.
9811038
===== ======================================================================
9821039

1040+
.. ts:cv:: CONFIG proxy.config.http.response_server.mode INT 1
1041+
:reloadable:
1042+
:overridable:
1043+
1044+
Specifies how the ``Server`` header is handled in responses:
1045+
1046+
===== ======================================================================
1047+
Value Description
1048+
===== ======================================================================
1049+
``0`` No ``Server`` header is added to the response.
1050+
``1`` The ``Server`` header is added according to
1051+
:ts:cv:`proxy.config.http.response_server_str`.
1052+
``2`` The ``Server`` header is added only if the response from origin does
1053+
not have one already.
1054+
===== ======================================================================
1055+
9831056
.. ts:cv:: CONFIG proxy.config.http.response_server_str STRING ATS/${PACKAGE_VERSION}
9841057
:reloadable:
9851058
:overridable:
@@ -3175,6 +3248,11 @@ Logging Configuration
31753248

31763249
.. ts:cv:: CONFIG proxy.config.log.logging_enabled INT 3
31773250
:reloadable:
3251+
:deprecated:
3252+
3253+
.. deprecated:: 10.1.0
3254+
3255+
This configuration is deprecated. Use :ts:cv:`proxy.config.log.logging.mode` instead.
31783256

31793257
Enables and disables event logging:
31803258

@@ -3189,6 +3267,22 @@ Logging Configuration
31893267

31903268
Refer to :ref:`admin-logging` for more information on event logging.
31913269

3270+
.. ts:cv:: CONFIG proxy.config.log.logging.mode INT 3
3271+
:reloadable:
3272+
3273+
Enables and disables event logging:
3274+
3275+
===== ===================================================================
3276+
Value Effect
3277+
===== ===================================================================
3278+
``0`` Logging disabled.
3279+
``1`` Log errors only.
3280+
``2`` Log transactions only.
3281+
``3`` Dual logging (errors and transactions).
3282+
===== ===================================================================
3283+
3284+
Refer to :ref:`admin-logging` for more information on event logging.
3285+
31923286
.. ts:cv:: CONFIG proxy.config.log.log_fast_buffer INT 0
31933287
:reloadable:
31943288

@@ -3264,6 +3358,32 @@ Logging Configuration
32643358

32653359
.. ts:cv:: CONFIG proxy.config.log.rolling_enabled INT 1
32663360
:reloadable:
3361+
:deprecated:
3362+
3363+
.. deprecated:: 10.1.0
3364+
3365+
This configuration is deprecated. Use :ts:cv:`proxy.config.log.rolling.mode` instead.
3366+
3367+
Specifies how log files are rolled. You can specify the following values:
3368+
3369+
===== ======================================================================
3370+
Value Description
3371+
===== ======================================================================
3372+
``0`` Disables log file rolling.
3373+
``1`` Enables log file rolling at specific intervals during the day
3374+
(specified with the :ts:cv:`proxy.config.log.rolling_interval_sec` and
3375+
:ts:cv:`proxy.config.log.rolling_offset_hr` variables).
3376+
``2`` Enables log file rolling when log files reach a specific size
3377+
(specified with :ts:cv:`proxy.config.log.rolling_size_mb`).
3378+
``3`` Enables log file rolling at specific intervals during the day or when
3379+
log files reach a specific size (whichever occurs first).
3380+
``4`` Enables log file rolling at specific intervals during the day when log
3381+
files reach a specific size (i.e. at a specified time if the file is
3382+
of the specified size).
3383+
===== ======================================================================
3384+
3385+
.. ts:cv:: CONFIG proxy.config.log.rolling.mode INT 1
3386+
:reloadable:
32673387

32683388
Specifies how log files are rolled. You can specify the following values:
32693389

@@ -3497,16 +3617,37 @@ Diagnostic Logging Configuration
34973617

34983618
.. ts:cv:: CONFIG proxy.config.diags.debug.enabled INT 0
34993619
:reloadable:
3620+
:deprecated:
3621+
3622+
.. deprecated:: 10.1.0
3623+
3624+
This configuration is deprecated. Use :ts:cv:`proxy.config.diags.debug.mode` instead.
35003625

35013626
When set to 1, enables logging for diagnostic messages whose log level is `diag` or `debug`.
35023627

35033628
When set to 2, interprets the :ts:cv:`proxy.config.diags.debug.client_ip` setting determine whether diagnostic messages are logged.
35043629

35053630
See the :ref:`Enable debug using traffic_ctl<traffic-control-command-server-debug>` for a convenient way to handle this.
35063631

3632+
.. ts:cv:: CONFIG proxy.config.diags.debug.mode INT 0
3633+
:reloadable:
3634+
3635+
Controls diagnostic debug message logging:
3636+
3637+
===== ======================================================================
3638+
Value Description
3639+
===== ======================================================================
3640+
``0`` Disables debug message logging.
3641+
``1`` Enables logging for diagnostic messages whose log level is `diag` or `debug`.
3642+
``2`` Interprets the :ts:cv:`proxy.config.diags.debug.client_ip` setting to
3643+
determine whether diagnostic messages are logged.
3644+
===== ======================================================================
3645+
3646+
See the :ref:`Enable debug using traffic_ctl<traffic-control-command-server-debug>` for a convenient way to handle this.
3647+
35073648
.. ts:cv:: CONFIG proxy.config.diags.debug.client_ip STRING NULL
35083649
3509-
if :ts:cv:`proxy.config.diags.debug.enabled` is set to 2, this value is tested against the source IP of the incoming connection. If there is a match, all the diagnostic messages for that connection and the related outgoing connection will be logged.
3650+
if :ts:cv:`proxy.config.diags.debug.mode` is set to 2, this value is tested against the source IP of the incoming connection. If there is a match, all the diagnostic messages for that connection and the related outgoing connection will be logged.
35103651

35113652
.. ts:cv:: CONFIG proxy.config.diags.debug.tags STRING http|dns
35123653
@@ -3578,6 +3719,30 @@ Diagnostic Logging Configuration
35783719

35793720
.. ts:cv:: CONFIG proxy.config.diags.logfile.rolling_enabled INT 0
35803721
:reloadable:
3722+
:deprecated:
3723+
3724+
.. deprecated:: 10.1.0
3725+
3726+
This configuration is deprecated. Use :ts:cv:`proxy.config.diags.logfile.rolling.mode` instead.
3727+
3728+
Specifies how the diagnostics log is rolled. You can specify the following values:
3729+
3730+
===== ======================================================================
3731+
Value Description
3732+
===== ======================================================================
3733+
``0`` Disables diagnostics log rolling.
3734+
``1`` Enables diagnostics log rolling at specific intervals (specified with
3735+
:ts:cv:`proxy.config.diags.logfile.rolling_interval_sec`). The "clock"
3736+
starts ticking on |TS| startup.
3737+
``2`` Enables diagnostics log rolling when the diagnostics log reaches a
3738+
specific size (specified with
3739+
:ts:cv:`proxy.config.diags.logfile.rolling_size_mb`).
3740+
``3`` Enables diagnostics log rolling at specific intervals or when the
3741+
diagnostics log reaches a specific size (whichever occurs first).
3742+
===== ======================================================================
3743+
3744+
.. ts:cv:: CONFIG proxy.config.diags.logfile.rolling.mode INT 0
3745+
:reloadable:
35813746

35823747
Specifies how the diagnostics log is rolled. You can specify the following values:
35833748

@@ -3959,6 +4124,11 @@ SSL Termination
39594124
SSL session cache for the origin server.
39604125

39614126
.. ts:cv:: CONFIG proxy.config.ssl.session_cache.enabled INT 2
4127+
:deprecated:
4128+
4129+
.. deprecated:: 10.1.0
4130+
4131+
This configuration is deprecated. Use :ts:cv:`proxy.config.ssl.session_cache.mode` instead.
39624132

39634133
Enables the SSL session cache:
39644134

@@ -3972,13 +4142,27 @@ SSL Termination
39724142
implementation.
39734143
===== ======================================================================
39744144

4145+
.. ts:cv:: CONFIG proxy.config.ssl.session_cache.mode INT 2
4146+
4147+
Specifies how the SSL session cache is configured:
4148+
4149+
===== ======================================================================
4150+
Value Description
4151+
===== ======================================================================
4152+
``0`` Disables the session cache entirely.
4153+
``1`` Enables the session cache using OpenSSL's implementation.
4154+
``2`` Default. Enables the session cache using |TS|'s implementation. This
4155+
implementation should perform much better than the OpenSSL
4156+
implementation.
4157+
===== ======================================================================
4158+
39754159
.. ts:cv:: CONFIG proxy.config.ssl.session_cache.timeout INT 0
39764160
39774161
This configuration specifies the lifetime of SSL session cache
39784162
entries in seconds. If it is ``0``, then the SSL library will use
39794163
a default value, typically 300 seconds. Note: This option has no affect
39804164
when using the |TS| session cache (option ``2`` in
3981-
``proxy.config.ssl.session_cache.enabled``)
4165+
``proxy.config.ssl.session_cache.mode``)
39824166

39834167
See :ref:`admin-performance-timeouts` for more discussion on |TS| timeouts.
39844168

@@ -4020,9 +4204,9 @@ SSL Termination
40204204
Take into account that setting the value to 0 will disable session caching for TLSv1.3
40214205
connections.
40224206

4023-
Lowering this setting to ``1`` can be interesting when ``proxy.config.ssl.session_cache.enabled`` is enabled because
4207+
Lowering this setting to ``1`` can be interesting when ``proxy.config.ssl.session_cache.mode`` is enabled because
40244208
otherwise for every new TLSv1.3 connection two session IDs will be inserted in the session cache.
4025-
On the other hand, if ``proxy.config.ssl.session_cache.enabled`` is disabled, using the default value is recommended.
4209+
On the other hand, if ``proxy.config.ssl.session_cache.mode`` is disabled, using the default value is recommended.
40264210
In those scenarios, increasing the number of tickets could be potentially beneficial for clients performing
40274211
multiple requests over concurrent TLS connections as per RFC 8446 clients SHOULDN'T reuse TLS Tickets.
40284212

doc/admin-guide/logging/rotation.en.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ To set log file rolling options and/or configure |TS| to roll log files when
148148
they reach a certain size, adjust the following settings in
149149
:file:`records.yaml`:
150150

151-
#. Enable log rolling with :ts:cv:`proxy.config.log.rolling_enabled`. ::
151+
#. Enable log rolling with :ts:cv:`proxy.config.log.rolling.mode`. ::
152152

153-
CONFIG proxy.config.log.rolling_enabled INT 1
153+
CONFIG proxy.config.log.rolling.mode INT 1
154154

155155
#. Configure the upper limit on log file size with
156156
:ts:cv:`proxy.config.log.rolling_size_mb`. ::

doc/admin-guide/logging/understanding.en.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Enabling Logs
4040
By default, |TS| creates both error and event log files and
4141
records system information in system log files. You can disable event
4242
logging and/or error logging by setting the configuration variable
43-
:ts:cv:`proxy.config.log.logging_enabled` in :file:`records.yaml`
43+
:ts:cv:`proxy.config.log.logging.mode` in :file:`records.yaml`
4444
to one of the following values:
4545

4646
===== =========================================================================

doc/admin-guide/performance/index.en.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ SSL-Specific Options
528528
~~~~~~~~~~~~~~~~~~~~
529529

530530
:ts:cv:`proxy.config.ssl.max_record_size`
531-
:ts:cv:`proxy.config.ssl.session_cache.enabled`
531+
:ts:cv:`proxy.config.ssl.session_cache.mode`
532532
:ts:cv:`proxy.config.ssl.session_cache.size`
533533

534534
Thread Types

doc/admin-guide/plugins/tcpinfo.en.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ The following options may be specified in :file:`plugin.config`:
121121
This logfile option allows you to set logfile rolling behaviour of
122122
the output log file without making any changes to the global
123123
logging configurations. This option overrides the
124-
:ts:cv:`proxy.config.output.logfile.rolling_enabled` setting in :file:`records.yaml`
124+
:ts:cv:`proxy.config.output.logfile.rolling.mode` setting in :file:`records.yaml`
125125
for the ``tcpinfo`` plugin. The setting may range from ``0`` to ``3``.
126126
``0`` disables logfile rolling. ``1`` is the ``default`` and enables logfile
127127
rolling at specific intervals set by ``--rolling-interval-sec`` discussed

0 commit comments

Comments
 (0)