Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhbBz-00051G-BU for pgadmin-hackers@arkaria.postgresql.org; Wed, 07 Sep 2016 11:38:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bhbBy-0005qi-Ia for pgadmin-hackers@arkaria.postgresql.org; Wed, 07 Sep 2016 11:38:58 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bhbBj-0005cO-HO for pgadmin-hackers@postgresql.org; Wed, 07 Sep 2016 11:38:43 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bhbBf-0002jD-Qx for pgadmin-hackers@postgresql.org; Wed, 07 Sep 2016 11:38:41 +0000 Received: by mail-wm0-x235.google.com with SMTP id 1so26915038wmz.1 for ; Wed, 07 Sep 2016 04:38:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LenCodzwYxQWM33uxqY4ilHIWbXKtEmC3mLoS+GuyXY=; b=TNjwySWTKgivzXnzzlagUQyDmMTH15mYRF2rIbazSLh95VBQ0RmrZ7XOUq50eMzO8B b1Dm8GfDSDlgGXCbchy3c9YEhFp77LuGdKv5KA2eg+nz+ANCpyEAfBi/9t3/KLzvuDhR sQqcV3GRHeAtcGRvmAAIKEIC8pq+o6Iy5tbv7k7Sg+jiIx2ALkH2fHGjetgQBkg2sWEq f3g9+LCbZxNcZ6oWGYTVjJI3c4CMvr0riG4QQeoDi1xp2/xh3Ip9FNRxdBftRH5L6sht qP504d2dgpP9fZNbEVYf1AqT2UqgV0GD9UUs+qbPJlcGeT8vuSyZL/pGNrpvlMK97NHA zKnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LenCodzwYxQWM33uxqY4ilHIWbXKtEmC3mLoS+GuyXY=; b=CkoEWmDGXm/zQ/ZlUQnMI32UwFzUZoChEIZEGlmUVFvHG9+MvMBMBQAjfNp/J5F+PS UPKGQFuwD8zMJr+K3qqu8CArmjxGjAcfAaDmVlE93QngV/JNGWFkq1RrmH3SP4TnIFZT YDKCJ4QRaEcEPdPkpDLnCgpe5gUji5/1+tfqLp0d2ADJzVwSRFYB/wec6XptMmxRkMNZ RY7I+3rNFSkGg787AV+sApSJBLXDJlYDy59BzNBaJGrUyKtXv10brwFuaBK+vv4sMhkP MwHBg+KWHO8FaH+pOqrx9ufFGyH+zy1M5tOdarmS8D7X+u/ZENIrOSxjEuu0Mio8ACvd CGCA== X-Gm-Message-State: AE9vXwOYM/BVpb3Edsn76d+ibTjduaMblynMS1V8c3OKddz1muVrk07+ABcLZ8sFyH0d+JwN32gnf3tqgCw9amL1 X-Received: by 10.28.92.82 with SMTP id q79mr3545217wmb.113.1473248318000; Wed, 07 Sep 2016 04:38:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.172.198 with HTTP; Wed, 7 Sep 2016 04:38:07 -0700 (PDT) In-Reply-To: References: From: Surinder Kumar Date: Wed, 7 Sep 2016 17:08:07 +0530 Message-ID: Subject: Re: Re: RM#1387 [Add-on PATCH] Bad handling of missing connection database server To: Akshay Joshi Cc: Dave Page , Ashesh Vashi , pgadmin-hackers Content-Type: multipart/mixed; boundary=001a1146fb7ea98ee2053be95ad2 X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --001a1146fb7ea98ee2053be95ad2 Content-Type: multipart/alternative; boundary=001a1146fb7ea98edd053be95ad0 --001a1146fb7ea98edd053be95ad0 Content-Type: text/plain; charset=UTF-8 Hi while closing query tool, the following error is display on python console. File "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/tools/datagrid/__init__.py", line 270, in close manager.release(did=cmd_obj.did, conn_id=cmd_obj.conn_id) File "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/utils/driver/psycopg2/__init__.py", line 1501, in release self.connections[my_id]._release() File "/Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/utils/driver/psycopg2/__init__.py", line 1002, in _release if self.wasConneted: AttributeError: 'Connection' object has no attribute 'wasConneted' *Issue:* This issue is due to typo. Please find attached patch. On Tue, Sep 6, 2016 at 6:35 PM, Akshay Joshi wrote: > Code looks good to me. Patch applied. > > On Tue, Sep 6, 2016 at 12:05 PM, Akshay Joshi < > akshay.joshi@enterprisedb.com> wrote: > >> >> >> On Fri, Sep 2, 2016 at 7:49 PM, Dave Page wrote: >> >>> Akshay, can you review/commit this please? >>> >> >> Sure. >> >>> >>> Thanks. >>> >>> On Tue, Aug 30, 2016 at 5:05 PM, Ashesh Vashi < >>> ashesh.vashi@enterprisedb.com> wrote: >>> >>>> On Tue, Aug 30, 2016 at 7:16 PM, Ashesh Vashi < >>>> ashesh.vashi@enterprisedb.com> wrote: >>>> >>>>> Hi Dave, >>>>> >>>>> Please find the add-on patch on top of the current change. >>>>> >>>>> Can you please take a look at it? >>>>> This mainly works on the postgres driver to make an attempt to >>>>> reconnect the server. >>>>> >>>> >>>> One more attempt with some more corner cases handling. >>>> * Handled the connection-lost, and object gone error on client side >>>> during 'refresh' operation. >>>> * Handle the reconnection more consistently (even during cursor object >>>> creation). >>>> >>>> Please take a look at it. >>>> >>>> -- >>>> >>>> Thanks & Regards, >>>> >>>> Ashesh Vashi >>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company >>>> >>>> >>>> >>>> *http://www.linkedin.com/in/asheshvashi* >>>> >>>> >>>>> >>>>> -- >>>>> >>>>> Thanks & Regards, >>>>> >>>>> Ashesh Vashi >>>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company >>>>> >>>>> >>>>> >>>>> *http://www.linkedin.com/in/asheshvashi* >>>>> >>>>> >>>> >>>> >>> >>> >>> -- >>> Dave Page >>> Blog: http://pgsnake.blogspot.com >>> Twitter: @pgsnake >>> >>> EnterpriseDB UK: http://www.enterprisedb.com >>> The Enterprise PostgreSQL Company >>> >> >> >> >> -- >> *Akshay Joshi* >> *Principal Software Engineer * >> >> >> >> *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* >> > > > > -- > *Akshay Joshi* > *Principal Software Engineer * > > > > *Phone: +91 20-3058-9517Mobile: +91 976-788-8246* > --001a1146fb7ea98edd053be95ad0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi<= /div>

while closing query tool,= the following error is display on python console.

=C2=A0 File "/U= sers/surinder/Documents/Projects/pgadmin4/web/pgadmin/tools/datagrid/__init= __.py", line 270, in close
=C2=A0 = =C2=A0 manager.release(did=3Dcmd_obj.did, conn_id=3Dcmd_obj.conn_id)
<= div class=3D"gmail_default">=C2=A0 File "/Users/surinder/Documents/Pro= jects/pgadmin4/web/pgadmin/utils/driver/psycopg2/__init__.py", line 15= 01, in release
=C2=A0 =C2=A0 self.connect= ions[my_id]._release()
=C2=A0 File "= /Users/surinder/Documents/Projects/pgadmin4/web/pgadmin/utils/driver/psycop= g2/__init__.py", line 1002, in _release
=C2=A0 =C2=A0 if self.wasConneted:
At= tributeError: 'Connection' object has no attribute 'wasConneted= '

Issue:
This issue is du= e to typo. Please find attached patch.

On Tue, Sep 6, 2016 at 6:35 PM, Aksh= ay Joshi <akshay.joshi@enterprisedb.com> wrote:<= br>
Code looks good to me. P= atch applied.=C2=A0

On Tue, Sep 6, 2016 at 12:0= 5 PM, Akshay Joshi <akshay.joshi@enterprisedb.com>= wrote:


On Fri, Sep 2, 2= 016 at 7:49 PM, Dave Page <dpage@pgadmin.org> wrote:
Akshay, can you review/commit t= his please?=C2=A0

=C2=A0 =C2= =A0 Sure.=C2=A0

Thanks.
=

On Tue, Aug 30, 2016 at 5:05 PM, Ashesh= Vashi <ashesh.vashi@enterprisedb.com> wrot= e:
On Tue, Au= g 30, 2016 at 7:16 PM, Ashesh Vashi <ashesh.vashi@enterprisedb= .com> wrote:
=
Hi Dave,

Please find the add-on= patch on top of the current change.

Can you pleas= e take a look at it?
This mainly works on the postgres driver to = make an attempt to reconnect the server.

<= /div>One more attempt with some more corner cases handling.
* Ha= ndled the connection-lost, and object gone error on client side during '= ;refresh' operation.
* Handle the reconnection more consisten= tly (even during cursor object creation).

Please t= ake a look at it.

--

Thanks & Regards,

Ashesh Vashi
Ente= rpriseDB INDIA:=C2=A0Enterprise PostgreSQL Company


http://www.linkedin.com/in/asheshvashi

=

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: Enterprise PostgreSQL Company


http://www.linkedin.com/in/asheshvashi





<= font color=3D"#888888">--
Dave = Page
Blog: htt= p://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: <= a href=3D"http://www.enterprisedb.com" target=3D"_blank">http://www.enterpr= isedb.com
The Enterprise PostgreSQL Company



--
Aks= hay Joshi
Principal Software Engineer=C2=A0
<= div>

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



--
<= b>Akshay Joshi
Principal Software Enginee= r=C2=A0

=