From 56c0b0825fea54b8d7d6a394a53cfb4592880b92 Mon Sep 17 00:00:00 2001 From: Onder Kalaci Date: Tue, 12 Jul 2016 11:48:55 +0300 Subject: [PATCH] Fix bug related to poll timeout This commit fixes a bug on setting polling timeout. The code updated to comform to the comment that is already placed. --- src/backend/distributed/executor/multi_client_executor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/distributed/executor/multi_client_executor.c b/src/backend/distributed/executor/multi_client_executor.c index 83c700133..88d465337 100644 --- a/src/backend/distributed/executor/multi_client_executor.c +++ b/src/backend/distributed/executor/multi_client_executor.c @@ -800,14 +800,14 @@ MultiClientRegisterWait(WaitInfo *waitInfo, TaskExecutionStatus executionStatus, void MultiClientWait(WaitInfo *waitInfo) { - long sleepIntervalPerCycle = RemoteTaskCheckInterval * 1000L; - /* * If we had a failure, we always want to sleep for a bit, to prevent * flooding the other system, probably making the situation worse. */ if (waitInfo->haveFailedWaiter) { + long sleepIntervalPerCycle = RemoteTaskCheckInterval * 1000L; + pg_usleep(sleepIntervalPerCycle); return; } @@ -828,7 +828,7 @@ MultiClientWait(WaitInfo *waitInfo) * times as long. */ int rc = poll(waitInfo->pollfds, waitInfo->registeredWaiters, - sleepIntervalPerCycle * 10); + RemoteTaskCheckInterval * 10); if (rc < 0) {