Skip to content

Commit 1ffaeda

Browse files
committed
docs update
1 parent 0e03f68 commit 1ffaeda

3 files changed

Lines changed: 49 additions & 8 deletions

File tree

doc/appendices/command-line/traffic_ctl.en.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,23 @@ Display the current value of a configuration record.
211211
configuration after any configuration file modification. If no configuration files have been
212212
modified since the previous configuration load, this command is a no-op.
213213

214+
The reload is **asynchronous**: the command sends a JSONRPC request to |TS| and returns
215+
immediately — it does not block until every config handler finishes. The actual reload work
216+
runs on background threads (``ET_TASK``), where each registered config handler loads its
217+
configuration and reports success or failure.
218+
214219
Every reload is assigned a **token** — a unique identifier for the reload operation. The token
215-
can be used to query the reload's status later via :option:`traffic_ctl config status`. If no
216-
token is provided via ``--token``, the server generates one automatically using a timestamp
217-
(e.g. ``rldtk-1739808000000``).
220+
is the handle you use to track, monitor, or query the reload after it starts. If no token is
221+
provided via ``--token``, the server generates one automatically using a timestamp (e.g.
222+
``rldtk-1739808000000``). You can supply a custom token via ``--token`` (e.g.
223+
``-t deploy-v2.1``) to tag reloads with meaningful labels for CI pipelines, deploy scripts, or
224+
post-mortem analysis.
225+
226+
Use the token to:
227+
228+
- **Monitor** a reload in real-time: ``traffic_ctl config reload -t <token> -m``
229+
- **Query** the final status: ``traffic_ctl config status -t <token>``
230+
- **Get detailed logs**: ``traffic_ctl config status -t <token> -l``
218231

219232
The timestamp of the last reconfiguration event (in seconds since epoch) is published in the
220233
``proxy.process.proxy.reconfigure_time`` metric.

doc/developer-guide/config-reload-framework.en.rst

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,23 @@ every handler must follow.
2929
Overview
3030
========
3131

32+
When a reload is requested (via :program:`traffic_ctl config reload` or the
33+
:ref:`admin_config_reload` JSONRPC API), the server does not block the caller. Instead, it:
34+
35+
1. **Assigns a token** to the reload — either auto-generated (e.g. ``rldtk-<timestamp>``) or
36+
user-supplied via ``-t``.
37+
2. **Schedules the reload** on background threads (``ET_TASK``). Each registered config handler
38+
runs, reports its status (``in_progress`` → ``success`` or ``fail``), and results are
39+
aggregated into a task tree.
40+
3. **Returns the token** immediately so the caller can track progress via
41+
:option:`traffic_ctl config status` or :ref:`get_reload_config_status`.
42+
43+
The **token** is the unique identifier for a reload operation — it is the handle used to monitor
44+
progress, query final status, and retrieve per-handler logs.
45+
3246
``ConfigRegistry`` is a centralized singleton that manages all configuration files, their reload
33-
handlers, trigger records, and file dependencies. When a reload is requested (via
34-
:program:`traffic_ctl` or the JSONRPC API — see :ref:`admin_config_reload` and
35-
:ref:`get_reload_config_status`), it coordinates execution, tracks progress per handler,
36-
and records the result in a queryable history.
47+
handlers, trigger records, and file dependencies. It coordinates execution, tracks progress per
48+
handler, and records the result in a queryable history.
3749

3850
Key capabilities:
3951

@@ -115,6 +127,14 @@ dependencies.
115127
"proxy.config.ssl.client.cert.filename",
116128
"proxy.config.ssl.server.session_ticket.enable"});
117129
130+
.. note::
131+
132+
When a config key has multiple trigger records, a change to **any** of them invokes the
133+
handler **once** per reload cycle — not once per record. The framework deduplicates
134+
internally: the first trigger creates a subtask for the config key; subsequent triggers
135+
for the same key in the same cycle are skipped. Handlers do not need to guard against
136+
duplicate invocations.
137+
118138

119139
register_static_file
120140
--------------------

doc/developer-guide/jsonrpc/jsonrpc-api.en.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,12 @@ admin_config_reload
922922
Description
923923
~~~~~~~~~~~
924924

925-
Initiate a configuration reload. This method supports two modes:
925+
Initiate a configuration reload. This method returns immediately — the actual reload runs
926+
asynchronously on background threads (``ET_TASK``). The response contains a **token** that the
927+
caller uses to track the reload's progress and query its final status via
928+
:ref:`get_reload_config_status`.
929+
930+
This method supports two modes:
926931

927932
- **File-based reload** (default) — re-reads all registered configuration files from disk and invokes
928933
their handlers for any files whose modification time has changed.
@@ -1135,6 +1140,7 @@ Field Type Description
11351140
``config_token`` |str| The reload token.
11361141
``status`` |str| Overall status: ``success``, ``fail``, ``in_progress``, ``timeout``.
11371142
``description`` |str| Human-readable description.
1143+
``config_key`` |str| Registry key used for deduplication (empty for main tasks).
11381144
``filename`` |str| Associated filename (empty for the main task).
11391145
``meta`` ``object`` Metadata: ``created_time_ms``, ``last_updated_time_ms``, ``main_task``.
11401146
``log`` ``array`` Log messages from the handler.
@@ -1175,6 +1181,7 @@ Response:
11751181
"config_token": "deploy-v2.1",
11761182
"status": "success",
11771183
"description": "Main reload task - 2025 Feb 17 12:00:00",
1184+
"config_key": "",
11781185
"filename": "",
11791186
"meta": {
11801187
"created_time_ms": "1739808000123",
@@ -1187,6 +1194,7 @@ Response:
11871194
"config_token": "deploy-v2.1",
11881195
"status": "success",
11891196
"description": "ip_allow",
1197+
"config_key": "ip_allow",
11901198
"filename": "/opt/ats/etc/trafficserver/ip_allow.yaml",
11911199
"meta": {
11921200
"created_time_ms": "1739808000200",

0 commit comments

Comments
 (0)