brbzull0 commented on PR #13842:
URL: https://github.com/apache/trafficserver/pull/13842#issuecomment-6201173247

   Examples of how a finished reload is graded, run as an AuTest against a real 
traffic_server. "master" is the same command with `traffic_ctl` built from 
master (c26c091e), and "this PR" is 0894eeb5. In these runs the printed report 
was the same in both; the exit status is what differs.
   
   **The rule:** the most severe log entry of the task and its sub-tasks is 
compared with `--error-level` (default `error`). A task that ended `fail` or 
`timeout` counts as at least `error`, and the entries of any other task count 
as at most `warn`. Below the level, a reload with a task that ended `timeout` 
exits 75 instead of 0.
   
   | # | Reload | Command | master | this PR |
   |---|---|---|---|---|
   | 1 | `success` with an `[Err]` entry: `cache.config` dropped a bad line | 
`config reload -m` | 0 | 0 |
   | 2 | same | `config status` | 0 | 0 |
   | 3 | same | `--error-level warn config status` | 0 | **2** |
   | 4 | clean `success` | `config reload -m` | 0 | 0 |
   | 5 | same; reload tasks log `[Note]` entries | `--error-level note config 
status` | 0 | **2** |
   | 6 | `fail`: `cache.config` is a directory | `config reload -m` | 2 | 2 |
   | 7 | same | `config status` | 0 | **2** |
   | 8 | same | `--error-level fatal config status` | 0 | 0 |
   | 9 | #6, then a reload that ended `success` | `config status -c 2` | 0 | 0 |
   | 10 | `timeout`: a plugin reload outlives 
`proxy.config.admin.reload.timeout` (1s) | `config reload -m` | 2 | 2 |
   | 11 | same | `--error-level fatal config reload -m` | 2 | **75** |
   
   Of the rows at the default level, #7 is the one that changes: `config 
status` exited 0 for a failed reload. In #9 the newest reload shown decides.
   
   <details>
   <summary>Output of #3, #7, #8 and #11</summary>
   
   ```
   $ traffic_ctl --error-level warn config status -t bad_line
   ✔ Reload [success] — bad_line
     ✔ 2 success  ◌ 0 in-progress  ✗ 0 failed  (2 total)
     Tasks:
      ✔ cache_control (…/cache.config)     1ms
         [Note]  cache.config loading ...
         [Err]   [CacheControl] not a valid IP address range at …/cache.config 
line 2
         [Note]  cache.config finished loading
      ✔ ssl_ticket_key ·······························    1ms
         [Note]  SSL ticket key loading ...
         [Note]  SSL ticket key reloaded
   exit=2
   ```
   
   ```
   $ traffic_ctl config status -t broken
   ✗ Reload [fail] — broken
     ✔ 1 success  ◌ 0 in-progress  ✗ 1 failed  (3 total)
     Tasks:
      ✗ cache_control (…/cache.config)     0ms  ✗ FAIL
         [Note]  cache.config loading ...
         [Err]   ControlMatcher - …/cache.config failed to load: Is a directory
         [Note]  cache.config finished loading
      ...
   exit=2
   
   $ traffic_ctl --error-level fatal config status -t broken
   (same report)
   exit=0
   ```
   
   ```
   $ traffic_ctl --error-level fatal config reload -t slow2 -m -w 0 -r 0.2 -d 
'cfg_plugin_deferred_test: {mode: ok}'
   ✔ Reload scheduled [slow2]
   ⟳ [slow2] ░░░░░░░░░░░░░░░░░░░░ 0/1  timeout  (1.0s)
   
     Details : traffic_ctl config status -t slow2
   exit=75
   ```
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to