acelyc111 commented on a change in pull request #5214:
URL: https://github.com/apache/incubator-doris/pull/5214#discussion_r554663569



##########
File path: be/src/olap/olap_server.cpp
##########
@@ -39,23 +39,28 @@ namespace doris {
 // number of running SCHEMA-CHANGE threads
 volatile uint32_t g_schema_change_active_threads = 0;
 
+// background threads is detached thread, but they will depend on 'this' 
pointer.
+// so we should pass a shared_from_this ptr to make sure that the pointer is 
not destroyed
+// before the thread exits

Review comment:
       In my opinion, we should ensure all threads stoped before destrory the 
StorageEngine instance, use smart pointer is a compromised way to resolve this 
problem. There is no reason to keep any thread running after StorageEngine 
stoped in main function.




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

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