print tg_ids with tg thread leak

This commit is contained in:
tushicheng
2023-08-15 10:41:02 +00:00
committed by ob-robot
parent 7d7e68e967
commit 7f4ebd09f5
3 changed files with 26 additions and 1 deletions

View File

@ -206,6 +206,12 @@ public:
{
return ht_.deserialization(archive, &allocer_);
}
template<class _callback>
int foreach_refactored(_callback &callback) const
{
return ht_.foreach_refactored(callback);
}
private:
_allocer allocer_;
_bucket_allocer bucket_allocer_;

View File

@ -238,7 +238,11 @@ void ObTenantBase::destroy()
{
destroy_mtl_module();
if (tg_set_.size() > 0) {
LOG_ERROR_RET(OB_ERR_UNEXPECTED, "tg thread not execute tg_destory make tg_id leak", K(tg_set_.size()), K(tg_set_));
TGSetDumpFunc tg_set_dump_func;
tg_set_.foreach_refactored(tg_set_dump_func);
_OB_LOG_RET(ERROR, OB_ERR_UNEXPECTED,
"tg thread not execute tg_destory make tg_id leak, tg_size=%ld, tg_set=[%s]",
tg_set_.size(), tg_set_dump_func.buf_);
}
tg_set_.destroy();
thread_dynamic_factor_map_.destroy();

View File

@ -406,6 +406,21 @@ friend class ObTenantSpaceFetcher;
friend class omt::ObTenant;
friend class ObTenantEnv;
struct TGSetDumpFunc
{
static const int64_t BUF_LEN = 128;
TGSetDumpFunc() : pos_(0)
{
MEMSET(buf_, '\0', BUF_LEN);
}
virtual ~TGSetDumpFunc() = default;
int operator()(common::hash::HashSetTypes<int64_t>::pair_type &kv)
{
return databuff_printf(buf_, BUF_LEN, pos_, " %ld", kv.first);
}
int64_t pos_;
char buf_[BUF_LEN];
};
template<class T> struct Identity {};
public: