vagetablechicken commented on issue #2893: Condition destroy error shouldn't be 
a fatal error
URL: 
https://github.com/apache/incubator-doris/issues/2893#issuecomment-587268035
 
 
   Yes, this method may not help. But it can avoid coredump when we restart be. 
Receiving too much coredump alert sms is too painful.
   😂 
   OK, let's consider the more perfect method.
   
   Stack trace is
   ```
   Check failure stack trace: ***
   @ 0x22f3e5d google::LogMessage::Fail()
   @ 0x22f5ce4 google::LogMessage::SendToLog()
   @ 0x22f3984 google::LogMessage::Flush()
   @ 0x22f6719 google::LogMessageFatal::~LogMessageFatal()
   @ 0xe9f09f doris::Condition::~Condition()
   @ 0x13a2d4d doris::TaskWorkerPool::~TaskWorkerPool()
   @ 0x13a2f71 doris::TaskWorkerPool::~TaskWorkerPool()
   @ 0x13a0b9b doris::AgentServer::~AgentServer()
   ```
   The thread created in TaskWorkerPool will be detached.
   
https://github.com/apache/incubator-doris/blob/625411bd280270e1aa026a03632f3f7f6140653d/be/src/agent/task_worker_pool.cpp#L261
   
   And because of that, when the Condition is destroying, the work threads may 
still running.
   If we want to ensure that all references should be completed before the 
object is released, we only have two choices:
   
   1. make threads joinable, waiting all threads finished in ~TaskWorkerPool() 
(p.s. it's similar with "wait in PTHREAD_COND_DESTROY_WITH_LOG" method.)
   1. interrupt the running threads in ~TaskWorkerPool()

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


With regards,
Apache Git Services

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

Reply via email to