!2641 修复WLM线程在内存不足时可能卡在PGconnectdb过程中阻塞数据库关闭

Merge pull request !2641 from kenxx/my_master
This commit is contained in:
opengauss-bot
2022-12-21 11:18:06 +00:00
committed by Gitee

View File

@ -1880,8 +1880,12 @@ void WLMReadjustUserSpaceByQuery(const char* username, List* database_name_list)
isFirstDb ? "true" : "false");
securec_check_ss(rc, "\0", "\0");
isFirstDb = false;
bool old = t_thrd.int_cxt.ImmediateInterruptOK;
/*Allow cancel/die interrupts because the connection might be stucked forever*/
t_thrd.int_cxt.ImmediateInterruptOK = true;
CHECK_FOR_INTERRUPTS();
pgConn = PQconnectdb(conninfo);
t_thrd.int_cxt.ImmediateInterruptOK = old;
if (PQstatus(pgConn) != CONNECTION_OK) {
ereport(WARNING,
(errcode(ERRCODE_CONNECTION_TIMED_OUT),