psycopg2 conn.poll() hangs when used with sshtunnel

From: Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>
To: psycopg(at)postgresql(dot)org
Subject: psycopg2 conn.poll() hangs when used with sshtunnel
Date: 2018-09-28 12:13:41
Message-ID: CANxoLDc4AosChXUhArLh2ufdon1BRwhCNRgGjyeCsYf9vHTmTw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

Hello

I am using psycopg2 2.7.4 to connect to the PostgreSQL database server
using asynchronoussupport. It is working absolutely fine. I have used
sshtunnel <https://pypi.org/project/sshtunnel/> v0.1.3 in pgAdmin4. When I
connect the PostgreSQL database server using ssh tunnel and run the
valid/correct query it works fine, but when I run any wrong query(invalid
column of table) my application gets hang on conn.poll() function.

Please refer the code how we use conn.poll() with timeouts
https://git.postgresql.org/gitweb/?p=pgadmin4.git;a=blob;f=web/pgadmin/utils/driver/psycopg2/connection.py;h=4f11c12b30882209c308cb3558e67189c97ea31e;hb=15fe26a7106610b710f3de5b604cd038302c926a#l1363

Can anyone please provide some pointers, suggestions?

--
*Akshay Joshi*

*Sr. Software Architect *

*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*

Responses

Browse psycopg by date

  From Date Subject
Next Message Christian Ferrari 2018-09-29 20:28:53 Re: Integration of Psycopg with XTA
Previous Message Federico Di Gregorio 2018-09-27 20:11:18 Re: Integration of Psycopg with XTA