fix dynamic thread not work
This commit is contained in:
@ -376,7 +376,7 @@ void ObResourceGroup::check_worker_count()
|
||||
workers_.remove(wnode);
|
||||
destroy_worker(w);
|
||||
} else if (w->has_req_flag()
|
||||
&& 0 != Thread::is_blocking_
|
||||
&& w->is_blocking()
|
||||
&& w->is_default_worker()) {
|
||||
++token;
|
||||
}
|
||||
@ -1363,7 +1363,7 @@ void ObTenant::check_worker_count()
|
||||
workers_.remove(wnode);
|
||||
destroy_worker(w);
|
||||
} else if (w->has_req_flag()
|
||||
&& 0 != Thread::is_blocking_
|
||||
&& w->is_blocking()
|
||||
&& w->is_default_worker()) {
|
||||
++token;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ ObThWorker::ObThWorker()
|
||||
priority_limit_(RQ_LOW), is_lq_yield_(false),
|
||||
query_start_time_(0), last_check_time_(0),
|
||||
can_retry_(true), need_retry_(false),
|
||||
has_add_to_cgroup_(false), last_wakeup_ts_(0)
|
||||
has_add_to_cgroup_(false), last_wakeup_ts_(0), is_blocking_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@ -321,6 +321,7 @@ void ObThWorker::worker(int64_t &tenant_id, int64_t &req_recv_timestamp, int32_t
|
||||
int64_t req_start_time = 0;
|
||||
int64_t req_end_time = 0;
|
||||
th_created();
|
||||
is_blocking_ = &Thread::is_blocking_;
|
||||
|
||||
ObTLTaGuard ta_guard(tenant_ != NULL? tenant_->id() : OB_SERVER_TENANT_ID);
|
||||
// Avoid adding and deleting entities from the root node for every request, the parameters are meaningless
|
||||
|
@ -85,8 +85,7 @@ public:
|
||||
|
||||
OB_INLINE bool is_group_worker() const { return OB_NOT_NULL(group_); }
|
||||
OB_INLINE bool is_level_worker() const { return get_worker_level() > 0; }
|
||||
OB_INLINE uint8_t priority_limit() const { return priority_limit_; }
|
||||
OB_INLINE void set_priority_limit(bool v=true) { priority_limit_ = v; }
|
||||
OB_INLINE void set_priority_limit(uint8_t limit) { priority_limit_ = limit; }
|
||||
OB_INLINE bool is_high_priority() const { return priority_limit_ == QQ_HIGH; }
|
||||
OB_INLINE bool is_normal_priority() const { return priority_limit_ == QQ_NORMAL; }
|
||||
OB_INLINE bool is_default_worker() const { return !is_group_worker() &&
|
||||
@ -101,7 +100,7 @@ public:
|
||||
OB_INLINE void set_lq_yield(bool v=true) { is_lq_yield_ = v; }
|
||||
OB_INLINE int64_t get_last_wakeup_ts() { return last_wakeup_ts_; }
|
||||
OB_INLINE void set_last_wakeup_ts(int64_t last_wakeup_ts) { last_wakeup_ts_ = last_wakeup_ts; }
|
||||
|
||||
OB_INLINE bool is_blocking() const { return OB_NOT_NULL(is_blocking_) && (0 != *is_blocking_); }
|
||||
private:
|
||||
void set_th_worker_thread_name(uint64_t tenant_id);
|
||||
void process_request(rpc::ObRequest &req);
|
||||
@ -135,7 +134,7 @@ private:
|
||||
bool has_add_to_cgroup_;
|
||||
|
||||
int64_t last_wakeup_ts_;
|
||||
|
||||
uint8_t* is_blocking_;
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ObThWorker);
|
||||
}; // end of class ObThWorker
|
||||
|
Reference in New Issue
Block a user