Hello Impala Public Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/24171
to look at the new patch set (#2).
Change subject: IMPALA-14876: Use char* for thread name in
impala::Thread::SuperviseThread
......................................................................
IMPALA-14876: Use char* for thread name in impala::Thread::SuperviseThread
impala::Thread::SuperviseThread() runs most of the backend threads. Its
first parameter is the thread name in std::string type. Backtraces in
pstack/gdb usually omit its value by just showing "name=...".
The thread name is important to find the thread of a given fragment
instance, e.g.,
"exec-finstance (finst:594ed4f65014cbd3:4bae840b00000001)",
"query-state-594ed4f65014cbd3:4bae840b00000000",
"scanner-thread (finst:594ed4f65014cbd3:4bae840b00000001, plan-node-id:0,
thread-idx:2)".
This patch improves this by changing the parameter type of 'name' to
const char* so the string can be actually printed. It's unexpected /
unsafe for SuperviseThread() to keep refering to parameters passed by
reference or pointer to it. So a thread local string is used to copy the
thread name and 'name' pointer is updated to point to it. See JIRA
comments for some examples.
Note that I have to add __attribute__((optimize("O0"))) to the method to
avoid 'name' being printed as "<optimized out>". This is a GCC
attribute. For clang, we use [[clang::optnone]].
Tests
- Manually tested pstacks on Rocky 9.7 when running a slow query:
select count(*) from functional.alltypes where sleep(100) < id;
Change-Id: I7fa831d4efd7d8665f9c69fcea960e8e1c47aa2b
---
M be/src/util/thread.cc
M be/src/util/thread.h
2 files changed, 31 insertions(+), 8 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/71/24171/2
--
To view, visit http://gerrit.cloudera.org:8080/24171
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7fa831d4efd7d8665f9c69fcea960e8e1c47aa2b
Gerrit-Change-Number: 24171
Gerrit-PatchSet: 2
Gerrit-Owner: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>