Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9PMK-0007v1-AO for psycopg@arkaria.postgresql.org; Mon, 08 Oct 2018 06:49:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g9PMH-0003mH-9Z for psycopg@arkaria.postgresql.org; Mon, 08 Oct 2018 06:49:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9PMG-0003m9-VY for psycopg@lists.postgresql.org; Mon, 08 Oct 2018 06:49:37 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g9PM8-0006uH-2A for psycopg@postgresql.org; Mon, 08 Oct 2018 06:49:36 +0000 Received: by mail-qt1-x843.google.com with SMTP id o17-v6so3954262qtr.1 for ; Sun, 07 Oct 2018 23:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=3LBQcUd5jVRPpCBNl/bLlwkFR3C0s/BTCT9l1DMXWtE=; b=st8Rn/nNeId3gaa4yuLbz2vXIE3/MdtMU/yEUrRFPKMtAHrjLiR6lutozy8AQ2a8Cd 4lDLythbNB0Kb4a12XMXOHw5r9xPIDrEBXCFDmDDrpTsYvKpVgpdrX0NCJfksz/jDpVn uoKyfsTcv2DDMegs6P7XtjIrJiwlkLcw6Z0Wc55YbjYcyD1LPNDn7cUBW4mFkPVS6onM b/GOI7GwqR5rjBlYDbADBqHdu+sFkbEpQLItsgjCgfgPE8+lJNsXe9v3yzdWwQoeQWl2 wFM8MFeBV/+TEvK7JHKfXf0f0In+vIvYlRfPLoNsJ0wG90uOMlmISsZoNjtRpzXW0suM tpag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=3LBQcUd5jVRPpCBNl/bLlwkFR3C0s/BTCT9l1DMXWtE=; b=nfOdoB1xHk0lyhcRh80DFPqVIPFX3tVUil6G1NWQ3x11V0nnJUF0DIQBrBxqWhIH9L M+ekcCfBrm1OjkB3m+iCbQlldETLHwbFjMvYIhrIUD0sGQ3OOh587jasYdksxfXNB+kV /f0LD6Xf7tPAJnjsq3jugjsiGcYbfLsh/6itWbP9psr6/QF2laK97BXciEGP7q8sk0Y1 nEf0Btk1hYzZH2D9SXbgwtIIW54KB+t+SRaV9iPoGXVGk+se3STID3T6wxgVGdI/YXWV dqzvNeQ4Xbjaw9DZ4T4DBNPQa0DvcB6iiboweUunL0JPXm57DEdCOwCXKoSOBRZ9Biv8 z6gQ== X-Gm-Message-State: ABuFfohJbkN8mp8izm1H/mkCLIj/eHh7TAs02L18HTMrxodcdEMLE20u rD8aCq6E7BRsLRoHtaCCMv3u0UPxMR8YWpKBnf1uamKNLnXPUQ== X-Google-Smtp-Source: ACcGV62cS6pecT6N/mGhNklryA+/ZFOd0hw5tthVGlWBc8sGoqb2kaOoSGT4S2ieymaYi/kKJEVE8ghYQeV4VZC/ia0= X-Received: by 2002:a0c:b62c:: with SMTP id f44-v6mr18600873qve.184.1538981365533; Sun, 07 Oct 2018 23:49:25 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Akshay Joshi Date: Mon, 8 Oct 2018 12:19:14 +0530 Message-ID: Subject: Re: psycopg2 conn.poll() hangs when used with sshtunnel To: psycopg@postgresql.org Content-Type: multipart/alternative; boundary="0000000000009be6ea0577b2054e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000009be6ea0577b2054e Content-Type: text/plain; charset="UTF-8" Hi Team As one issue(*https://github.com/psycopg/psycopg2/issues/781 *) has already been created for conn.poll() function hangs when executes COPY command in async mode. Similarly conn.poll() functions hangs when we run wrong query in async mode using sshtunnel v0.1.3. Can someone please suggest what went wrong when used sshtunnel, or the pointers/reason where poll() method hangs. On Fri, Sep 28, 2018 at 5:43 PM Akshay Joshi wrote: > 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 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* > -- *Akshay Joshi* *Sr. Software Architect * *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* --0000000000009be6ea0577b2054e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Team=C2=A0

As one i= ssue(https://= github.com/psycopg/psycopg2/issues/781) has already been created fo= r conn.poll() function hangs when executes COPY command in async mode. Simi= larly conn.poll() functions hangs when we run wrong query in async mode usi= ng=C2=A0sshtunnel=C2=A0v0.1.3.

Can someone p= lease suggest what went wrong when used sshtunnel, or the pointers/reason w= here poll() method hangs.=C2=A0 =C2=A0=C2=A0

On Fri, Sep 28, 2018 at 5:43 PM Akshay J= oshi <akshay.joshi@enterprisedb.com> wrote:

Hello

I am using=C2=A0<= span style=3D"box-sizing:border-box;font-weight:600">psycopg2 2.7.4= =C2=A0to connect to the PostgreSQL database server using=C2=A0asynchronoussupport. It i= s working absolutely fine. I have used=C2=A0sshtunnel=C2=A0v0.1.3 in=C2=A0pgAdmin4. When I connect the PostgreSQL dat= abase 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 ge= ts hang on conn.poll() function.

Please refer the code how we use conn.poll() with timeouts=C2=A0https://gi= t.postgresql.org/gitweb/?p=3Dpgadmin4.git;a=3Dblob;f=3Dweb/pgadmin/utils/dr= iver/psycopg2/connection.py;h=3D4f11c12b30882209c308cb3558e67189c97ea31e;hb= =3D15fe26a7106610b710f3de5b604cd038302c926a#l1363

Can anyone please provide some pointers, sugge= stions?


--
<= span style=3D"color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;= border-collapse:collapse">Akshay Joshi
Sr. Software Architect


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


--
Akshay Joshi
Sr. Software Architect <= br>


=
Pho= ne: +91 20-3058-9517
Mobile: +91 976-788-8246
--0000000000009be6ea0577b2054e--