diff --git a/web/pgadmin/utils/driver/abstract.py b/web/pgadmin/utils/driver/abstract.py index 271bfeca..5fe65bc4 100644 --- a/web/pgadmin/utils/driver/abstract.py +++ b/web/pgadmin/utils/driver/abstract.py @@ -169,6 +169,7 @@ class BaseConnection(object): ASYNC_NOT_CONNECTED = 4 ASYNC_EXECUTION_ABORTED = 5 ASYNC_TIMEOUT = 0.2 + ASYNC_WAIT_TIMEOUT = 2 ASYNC_NOTICE_MAXLENGTH = 100000 @abstractmethod diff --git a/web/pgadmin/utils/driver/psycopg2/connection.py b/web/pgadmin/utils/driver/psycopg2/connection.py index 6dd73ecd..4143d311 100644 --- a/web/pgadmin/utils/driver/psycopg2/connection.py +++ b/web/pgadmin/utils/driver/psycopg2/connection.py @@ -1335,13 +1335,16 @@ Failed to reset the connection to the server due to following error: if state == psycopg2.extensions.POLL_OK: break elif state == psycopg2.extensions.POLL_WRITE: - select.select([], [conn.fileno()], []) + select.select([], [conn.fileno()], [], + self.ASYNC_WAIT_TIMEOUT) elif state == psycopg2.extensions.POLL_READ: - select.select([conn.fileno()], [], []) + select.select([conn.fileno()], [], [], + self.ASYNC_WAIT_TIMEOUT) else: raise psycopg2.OperationalError( "poll() returned %s from _wait function" % state) + def _wait_timeout(self, conn): """ This function is used for the asynchronous connection,