Copilot commented on code in PR #13032:
URL: https://github.com/apache/trafficserver/pull/13032#discussion_r4132176745


##########
src/traffic_ctl/CtrlPrinters.cc:
##########
@@ -61,15 +61,18 @@ 
print_record_error_list(std::vector<shared::rpc::RecordLookUpResponse::RecordErr
 void
 BasePrinter::write_output(shared::rpc::JSONRPCResponse const &response)
 {
+  // A response never clears an exit status an earlier step already set.
+  if (auto const code = appExitCodeFromResponse(response); code != CTRL_EX_OK) 
{
+    App_Exit_Status_Code = code;
+  }

Review Comment:
   This grading hook is bypassed by the append path in 
`ServerCommand::server_debug`: its preliminary `RecordLookupRequest` is only 
checked with `is_error()` and, on error, is neither sent to `write_output()` 
nor treated as a failed command before the subsequent update request. A server 
error from that decoded response can therefore be hidden and never affect the 
exit status, contrary to the “every command” behavior; route this response 
through the printer and stop/handle the append operation when it fails.



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