Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHTVT-0008QH-CG for psycopg@arkaria.postgresql.org; Tue, 30 Oct 2018 12:52:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHTVR-0000iy-OF for psycopg@arkaria.postgresql.org; Tue, 30 Oct 2018 12:52:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHTVR-0000iq-8k for psycopg@lists.postgresql.org; Tue, 30 Oct 2018 12:52:25 +0000 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gHTVO-0007iI-33 for psycopg@postgresql.org; Tue, 30 Oct 2018 12:52:24 +0000 Received: by mail-lj1-x230.google.com with SMTP id z80-v6so5152922ljb.8 for ; Tue, 30 Oct 2018 05:52:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1bB7LOeGpnHN6v5kY7QXfx93E6aBO9PpFlcwCEMfYqo=; b=c/zVHwi3zRV8d37l/8rJ8nwLj6YmHdxrNAIXgXXYNoIW4VdQgOUfztpGWC5WZ7PK4C mlbu/4movuU+hHD3lOoF0uwS5nBJ74wyxY/YHuhNp9kcOpdK0uvdO//MejtjIuD1CBST UQ0SnUzFOyVXtn3ScsivlnYmJlKCaFX2Jp2shV+c3nKLnBPEdrHQuBkmku2J29F2UCuc UvcVUEq9Gu7ih5xwMhngthuLOAtL280oeeUrSeA0C1fKLExxKVcNcxVTFlzNshSa2rBo zUhOcB+gj/tZC2ec7H8vWleL5Z+6SZZH4ZAZYbK/pwJJZQOMKcNDWwsK+8hlWBIgNs8D 5Thg== 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:cc; bh=1bB7LOeGpnHN6v5kY7QXfx93E6aBO9PpFlcwCEMfYqo=; b=AsD6gVHdXVdyTYpM8qjltLGK/KPyU2rRMm6Md6hqMASENX9l6SEfFIJ5Vp+sUPeeQs /g3VvI34p8V34hdhcHrFWh0995JQIubp0pc2OXuwPwqx/xP5ZxaF/n3ZnjtUhUMbpD2J l8QpmPlPk2XBvhbIKt3BPGKW6AdNYJCNOd3t2pAQvVlSnbmuQbttQ1rtNaOBC14ENWL8 /MY0TXPRFJ0+/0X9BffRp8f7v9PSg3FPvF9rp+QHm8HnRzPtOUVMzvlEBlD6CGEYakpp 2ElUSFcBc6N1McErl38VFyJpz7VCGq/XZW8Zwm2ZAfjmHuBKYq8L1pMDHGMp6tBTW7Uy XwOw== X-Gm-Message-State: AGRZ1gL7IWYGJ7ftHGdMtb/BYabnY+hEhE7RmqWFIaov/vfwXdKhUfNn UE5L47+W/Urv7q31RVLyRFpAf6XyxEgE6UTMAMY= X-Google-Smtp-Source: AJdET5eyG1i4FhNNUq3SjNEa0d9lhNywDvX+m4X2YKtPhKcd/wRmgUcYOAuKgK5wAVAAbtHa3si8cMAf9EkOech7QVU= X-Received: by 2002:a2e:55d3:: with SMTP id g80-v6mr5534216lje.78.1540903939911; Tue, 30 Oct 2018 05:52:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Daniele Varrazzo Date: Tue, 30 Oct 2018 12:52:08 +0000 Message-ID: Subject: Re: psycopg2 conn.poll() hangs when used with sshtunnel To: Akshay Joshi Cc: psycopg@postgresql.org Content-Type: multipart/alternative; boundary="000000000000f8b436057971a768" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000f8b436057971a768 Content-Type: text/plain; charset="UTF-8" Taking a look. Thank you for the test. On Tue, Oct 30, 2018 at 12:36 PM Akshay Joshi wrote: > Hi Team > > I have created one sample application to replicate the issue. Attached is > the sample application, please read "README.txt" file to proceed further. > Can someone please suggest why poll() function hangs when run wrong query > with sshtunnel v0.1.4. > > On Mon, Oct 8, 2018 at 12:19 PM Akshay Joshi < > akshay.joshi@enterprisedb.com> wrote: > >> 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 < >> akshay.joshi@enterprisedb.com> 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* >> > > > -- > *Akshay Joshi* > > *Sr. Software Architect * > > > > *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* > --000000000000f8b436057971a768 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Taking a look. Thank you for the test.

On Tue, Oct 30, 2018 at 12:36 PM Akshay J= oshi <akshay.joshi@ente= rprisedb.com> wrote:
Hi Team=C2=A0

I have created one sample applic= ation to replicate the issue. Attached is the sample application, please re= ad "README.txt" file to proceed=C2=A0further.
Can someo= ne please suggest why poll() function hangs when run wrong query with sshtu= nnel v0.1.4.

On = Mon, Oct 8, 2018 at 12:19 PM Akshay Joshi <akshay.joshi@enterprisedb.com>= wrote:
Hi Team=C2=A0

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 c= onn.poll() functions hangs when we run wrong query in async mode using=C2= =A0sshtunnel=C2=A0v0.1.3.

Can someone plea= se suggest what went wrong when used sshtunnel, or the pointers/reason wher= e poll() method hangs.=C2=A0 =C2=A0=C2=A0

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

= Hello

I am using=C2=A0psycopg2 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?


--
Akshay = Joshi
Sr. Software Architect


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


--
Ak= shay Joshi
Sr. Software Architect
<= font color=3D"#3333FF">
=
=
Phone: +91 20-3058-9517
Mobil= e: +91 976-788-8246


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


=
Pho= ne: +91 20-3058-9517
Mobile: +91 976-788-8246
--000000000000f8b436057971a768--