提交 25bc3855 编写于 作者: A Asim R P 提交者: Asim RP

Avoid infinite loop in processCopyEndResults

The command "COPY enumtest FROM stdin;" hit an infinite loop on merge
branch.  Code indicates that the issue can happen on master as well.
QD backend went into infinite loop when the connection was already
closed from QE end.  The TCP connection was in CLOSE_WAIT state.
Libpq connection status was CONNECTION_BAD and asyncStatus was
PGASYNC_BUSY.

Fix the infinite loop by checking libpq connection status in each
iteration.
上级 88abdd0f
......@@ -493,7 +493,7 @@ processCopyEndResults(CdbCopy *c,
pollRead->events = POLLIN;
pollRead->revents = 0;
while (PQisBusy(q->conn))
while (PQisBusy(q->conn) && PQstatus(q->conn) == CONNECTION_OK)
{
if ((Gp_role == GP_ROLE_DISPATCH) && InterruptPending)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册