Global SysCache

Offering: openGaussDev

More detail:
	    修复线程池模式waitmission起事务后内存上下文不正确导致内存泄漏问题

Match-id-18f61b45531eaa886b7b7cf2bce9bf6c97a901fb
This commit is contained in:
openGaussDev 2022-03-07 18:18:49 +08:00 committed by yanghao
parent 38b7213f8e
commit 6dc2d139d5
1 changed files with 3 additions and 1 deletions

View File

@ -185,6 +185,8 @@ void ThreadPoolWorker::WaitMission()
* before we serve next session we must keep us clean.
*/
PreventSignal();
MemoryContext old = CurrentMemoryContext;
while (true) {
/* we should keep the thread clean for next Session. */
CleanThread();
@ -222,7 +224,7 @@ void ThreadPoolWorker::WaitMission()
break;
}
}
MemoryContextSwitchTo(old);
(void)disable_session_sig_alarm();
/* now we can accept signal. out of this, we rely on signal handle. */
AllowSignal();