brbzull0 commented on code in PR #13842:
URL: https://github.com/apache/trafficserver/pull/13842#discussion_r4283195003


##########
src/traffic_ctl/CtrlCommands.cc:
##########
@@ -351,6 +366,8 @@ ConfigCommand::config_status()
     for (const auto &task : resp.tasks) {
       _printer->as<ConfigReloadPrinter>()->print_reload_report(task, true);
     }
+    // The server lists the newest reload last. Older ones shown with --count 
are history and are not graded.
+    grade_reload(resp.tasks.back());

Review Comment:
   The server lists the oldest reload first, so `resp.tasks.back()` is the 
newest. `ReloadCoordinator` appends each new reload to `_history` with 
`push_back` 
([ReloadCoordinator.cc#L88](https://github.com/apache/trafficserver/blob/c26c091e8baaade7ee6f16bd0b562b0828eb203b/src/mgmt/config/ReloadCoordinator.cc#L88)),
 `get_all()` copies the last N in that order 
([ReloadCoordinator.cc#L224-L230](https://github.com/apache/trafficserver/blob/c26c091e8baaade7ee6f16bd0b562b0828eb203b/src/mgmt/config/ReloadCoordinator.cc#L224-L230)),
 and the status handler sends them as they come 
([Configuration.cc#L411-L416](https://github.com/apache/trafficserver/blob/c26c091e8baaade7ee6f16bd0b562b0828eb203b/src/mgmt/rpc/handlers/config/Configuration.cc#L411-L416)).
 The "Most recent first" comment on `get_all()` 
([ReloadCoordinator.h#L44](https://github.com/apache/trafficserver/blob/c26c091e8baaade7ee6f16bd0b562b0828eb203b/include/mgmt/config/ReloadCoordinator.h#L44))
 does not match the code.
   
   Checked against traffic_server: after a failed reload `older` and then a 
successful one, `newer`, `traffic_ctl config status -c 2` prints `older` first 
and `newer` last, and exits 0. Grading `front()` would grade `older` and exit 2.
   



-- 
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