brbzull0 commented on code in PR #13842:
URL: https://github.com/apache/trafficserver/pull/13842#discussion_r4292692541
##########
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:
`resp.tasks.back()` is only reached inside `if (resp.tasks.size() > 0)`
([CtrlCommands.cc#L365-L371](https://github.com/apache/trafficserver/blob/0894eeb5a40efa1ad0b9ed3b462433f3642dbf81/src/traffic_ctl/CtrlCommands.cc#L365-L371)),
the same block that prints the reports on master. A reply with no tasks prints
nothing and exits 0, as on master. When there is no reload to show,
traffic_server answers with a "No reload tasks found" error instead, which
takes the `resp.error` branch above it
([#L359-L363](https://github.com/apache/trafficserver/blob/0894eeb5a40efa1ad0b9ed3b462433f3642dbf81/src/traffic_ctl/CtrlCommands.cc#L359-L363))
and exits 2.
##########
src/traffic_ctl/TrafficCtlStatus.h:
##########
@@ -27,6 +27,7 @@ limitations under the License.
#include <string>
#include <string_view>
+#include "jsonrpc/ctrl_yaml_codecs.h"
Review Comment:
Agreed. `appExitCodeFromReload()` needs only the reload types, so
`TrafficCtlStatus.h` now includes `jsonrpc/CtrlRPCRequests.h`. The unit test
decodes replies, so it includes `jsonrpc/ctrl_yaml_codecs.h` itself. Done in
dc200bba82759573002b363d75f6faa0145d8c74.
--
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]