Repository navigation
reef: log: save/fetch thread name infra - #60728
Conversation
* pthread name is saved in a thread_local storage * the thread_local name is copied into Entry object's ctor * Log::dump_recent() reads the thread name from the Entry object's data member when dumping logs Fixes: https://tracker.ceph.com/issues/50743 Signed-off-by: Milind Changire <[email protected]> (cherry picked from commit 0be8d01)
Fixes: 0be8d01 Fixes: https://tracker.ceph.com/issues/68691 Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit 1f40d0c) Signed-off-by: Milind Changire <[email protected]>
This provides common ceph entrypoints for the pthread_[gs]name functions which will also cache a thread_local copy. This also removes the pthread_t parameter which precipitated the bug i50743. Obviously, the overall goal here is to avoid system calls. Conflicts: src/ceph_nvmeof_monitor_client.cc (not available in reef) src/common/ceph_timer.h src/include/compat.h src/mds/Beacon.cc src/rgw/driver/rados/rgw_notify.cc src/rgw/rgw_lua_background.cc (not available in reef) See-also: https://tracker.ceph.com/issues/50743 Fixes: 0be8d01 Fixes: https://tracker.ceph.com/issues/68691 Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit 7de5af5) Signed-off-by: Milind Changire <[email protected]>
In general, a pthread implementation reuses thread ids routinely so the circular_buffer is there to help us see what the thread name was historically (capped at 4 entries). However, to guard against this map from growing without bound, discard entries that are more than a day old. This would happen if a thread logged an Entry and has since disappeared for more than a day. Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit bfe489e) Signed-off-by: Milind Changire <[email protected]>
To be consistent and sensical. Signed-off-by: Patrick Donnelly <[email protected]> (cherry picked from commit a2a989a) Signed-off-by: Milind Changire <[email protected]> Conflicts: src/mds/MDLog.cc (no upkeep thread in reef) src/mds/QuiesceAgent.h (not available in reef) src/mds/QuiesceDbManager.cc (not available in reef)
Since ceph_pthread_setname() has now been moved from a macro to a function, we need to reference the common library to link it to. Signed-off-by: Milind Changire <[email protected]>
4773f7a to
4d6eed0
Compare
|
jenkins test make check |
|
jenkins test api |
2 similar comments
|
jenkins test api |
|
jenkins test api |
|
@batrick please take a look |
|
This PR is under test in https://tracker.ceph.com/issues/69015. |
|
In one of the MDS logs: In the above list, the following thread IDs have no names: @batrick please see if this is concerning |
|
It's an upgrade test from quincy (which doesn't have this change)? |
thanks @vshankar please approve and merge PR ... tests do not show any crashes |
| if (const auto rc = ceph_pthread_setname(workers.back().native_handle(), | ||
| thread_name.c_str()); rc != 0) { | ||
| if (const auto rc = ceph_pthread_setname(thread_name.c_str()); rc != 0) { |
There was a problem hiding this comment.
are we tracking any regressions from this change?
from rgw bug report https://tracker.ceph.com/issues/71044:
Since radosgw 18.2.5 the basename of the radosgw process is set to notif-worker0 instead of radosgw
this backport was new in 18.2.5. somehow this notif-worker0 string is ending up as the process name?
There was a problem hiding this comment.
we also appear to be getting crash dumps that refer to thread_name:notif-worker0:
2025-04-25T06:04:01.563+0000 7f1b64491640 -1 *** Caught signal (Aborted) **
in thread 7f1b64491640 thread_name:notif-worker0
but are not actually happening on this thread
There was a problem hiding this comment.
7de5af5#diff-e05836df60adf79bd9d629146b894bcd2ac828ea23a63c324e87b20cf7650d72L21-R786
The cherry-pick of that commit seems to have dropped changes in this PR as part of conflict resolution. That's probably the bug.
There was a problem hiding this comment.
.1
backport tracker: https://tracker.ceph.com/issues/68651
backport of #60058
parent tracker: https://tracker.ceph.com/issues/50743
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh
=====
.2
backport tracker: https://tracker.ceph.com/issues/68926
backport of #60464
parent tracker: https://tracker.ceph.com/issues/68691