spaces-X opened a new issue #6890:
URL: https://github.com/apache/incubator-doris/issues/6890


   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### Description
   
   When `BE` crushed with a segment fault, the signal info will be dumped to 
`be.out` by `glog`, including the corresponding thread id generated by 
`pthread_self()`.  See 
[here](https://github.com/google/glog/blob/master/src/signalhandler.cc#L212:6).
   
   The thread ID printed in the current BE INFO log is implemented by 
`gettid()`. See 
[here](https://github.com/google/glog/blob/master/src/utilities.cc#L259:7) .
   
   The thread IDs generated by the above two methods are different and cannot 
be converted into each other.
   Add the thread id generated by pthread_self() in the be info log can make it 
to be converted into each other and it helps a lot to find the corresponding 
query id when the coredump is off.
   
   
   
   ### Use case
   
   be.out:  get thread id `TID 0x7f8913d6b700`
   ```
   *** Aborted at 1634633864 (unix time) try "date -d @1634633864" if you are 
using GNU date ***
   PC: @          0x100a051 doris::FragmentMgr::exec_actual()
   *** SIGSEGV (@0x1f400040292) received by PID 259721 () from PID 262802; 
stack trace: ***
       @     0x7f895fd34630 (unknown)
       @          0x100a051 doris::FragmentMgr::exec_actual()
       @          0x100fefc std::_Function_handler<>::_M_invoke()
       @          0x11b9f42 doris::ThreadPool::dispatch_thread()
       @          0x11b1da8 doris::Thread::supervise_thread()
       @     0x7f895fd2cea5 start_thread
       @     0x7f895f1318dd __clone
   ```
   
   hex to dec
   ```
   [root@be01 log]$ printf "%d\n" 0x7f8913d6b700
   140226720085760
   ```
   
   
   
   be.info: grep thread id `140226720085760` to  find the querry id 
   ```
   I1019 16:57:26.899314 260721 fragment_mgr.cpp:441] _exec_actual(): 
query_id=65f2a43c82a545ee-8cb7fb6d969fa263 
fragment_instance_id=65f2a43c82a545ee-8cb7fb6d969fa264 thread id by 
pthread_self()=140226720085760
   ```
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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