fix memory-leak bug of mview scheduler job
This commit is contained in:
parent
7ebca32602
commit
3582dcb33b
@ -352,8 +352,12 @@ int ObMViewSchedJobUtils::calc_date_expression(
|
||||
LOG_WARN("job is not date expression job class",
|
||||
KR(ret), K(job_info.is_date_expression_job_class()));
|
||||
} else {
|
||||
ContextParam ctx_param;
|
||||
ctx_param.set_mem_attr(common::OB_SERVER_TENANT_ID, "MVSchedTmp");
|
||||
CREATE_WITH_TEMP_CONTEXT(ctx_param) {
|
||||
ObIAllocator &tmp_allocator = CURRENT_CONTEXT->get_arena_allocator();
|
||||
SMART_VAR(ObSQLSessionInfo, session) {
|
||||
if (OB_FAIL(session.init(1, 1, nullptr/*bucket_allocator*/))) {
|
||||
if (OB_FAIL(session.init(1, 1, &tmp_allocator))) {
|
||||
LOG_WARN("failed to init session", KR(ret));
|
||||
} else if (OB_FAIL(ObDBMSSchedJobUtils::init_env(job_info, session))) {
|
||||
LOG_WARN("failed to init env", KR(ret), K(job_info));
|
||||
@ -367,7 +371,6 @@ int ObMViewSchedJobUtils::calc_date_expression(
|
||||
|
||||
int64_t current_time = ObTimeUtility::current_time() / 1000000L * 1000000L; // ignore micro seconds
|
||||
int64_t next_time = 0;
|
||||
ObArenaAllocator tmp_allocator("MVSchedTmp");
|
||||
if (OB_FAIL(calc_date_expr_from_str(session, tmp_allocator,
|
||||
tenant_id, job_info.get_interval(), next_time))) {
|
||||
LOG_WARN("failed to calc date expression from str", KR(ret),
|
||||
@ -387,6 +390,7 @@ int ObMViewSchedJobUtils::calc_date_expression(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user