github-actions[bot] commented on code in PR #63051:
URL: https://github.com/apache/doris/pull/63051#discussion_r3245475884


##########
cloud/src/common/http_helper.cpp:
##########
@@ -721,7 +721,7 @@ HttpResponse process_recycle_copy_jobs(RecyclerServiceImpl* 
service, brpc::Contr
         return http_json_reply(MetaServiceCode::INVALID_ARGUMENT, "no instance 
id");
     }
     MetaServiceCode code = MetaServiceCode::OK;
-    std::string msg;
+    std::string msg = "OK";
     recycle_copy_jobs(service->txn_kv(), *instance_id, code, msg,
                       service->recycler()->thread_pool_group(), 
service->txn_lazy_committer());

Review Comment:
   This default `OK` message is unsafe for this endpoint because 
`recycle_copy_jobs()` has a concrete early return where it does not overwrite 
`code` or `msg`: after loading the instance, `InstanceRecycler::init()` can 
fail and `recycler_service.cpp` logs the failure then returns. With this 
initialization, the HTTP response remains `200` with body/message `OK` even 
though the manual recycle job was never started. Please set a non-OK 
code/message on that init failure path, or avoid pre-filling `msg` for callees 
that can fail without updating it.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to