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


##########
be/src/service/doris_main.cpp:
##########
@@ -614,6 +614,7 @@ int main(int argc, char** argv) {
         if (!status.ok()) {
             std::cerr << msg << '\n';
             service->stop_works();
+            exec_env->destroy();

Review Comment:
   This destroys `ExecEnv` while services that were already started in earlier 
steps may still be running. For example, if `http_service->start()` or 
heartbeat/flight startup fails, `be_server` and/or `brpc_service` have already 
started and their handlers retain `ExecEnv`/storage pointers; `exit()` will not 
unwind these local `unique_ptr`s, and `service->stop_works()` only stops the 
agent report workers. That leaves a window where RPC/HTTP worker threads can 
enter handlers while `ExecEnv::destroy()` is tearing down storage, caches, and 
thread pools. Please stop/reset any services that have successfully started 
(mirroring the normal shutdown order below) before calling 
`exec_env->destroy()` on this failure path.



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