[CP] fix sqc handler memory leak when drop tenant

This commit is contained in:
obdev
2024-02-08 09:47:28 +00:00
committed by ob-robot
parent 38c85c932c
commit 51a7041b17
5 changed files with 63 additions and 9 deletions

View File

@ -148,7 +148,7 @@ private:
ObPxSqcHandler *sqc_handler_;
};
void PxWorkerFunctor::operator ()()
void PxWorkerFunctor::operator ()(bool need_exec)
{
int ret = OB_SUCCESS;
ObCurTraceId::set(env_arg_.get_trace_id());
@ -163,7 +163,9 @@ void PxWorkerFunctor::operator ()()
const bool enable_trace_log = lib::is_trace_log_enabled();
//ensure PX worker skip updating timeout_ts_ by ntp offset
THIS_WORKER.set_ntp_offset(0);
if (OB_FAIL(px_int_guard.get_interrupt_reg_ret())) {
if (!need_exec) {
LOG_INFO("px pool already stopped, do not execute the task.");
} else if (OB_FAIL(px_int_guard.get_interrupt_reg_ret())) {
LOG_WARN("px worker failed to SET_INTERRUPTABLE");
} else if (OB_NOT_NULL(sqc_handler) && OB_LIKELY(!sqc_handler->has_interrupted())) {
THIS_WORKER.set_worker_level(sqc_handler->get_rpc_level());

View File

@ -198,7 +198,7 @@ public:
~PxWorkerFunctor() = default;
// px thread will invoke this function.
void operator ()();
void operator ()(bool need_exec);
PxWorkerFunctor &operator = (const PxWorkerFunctor &other) {
if (&other != this) {