Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iZRfU-0002FS-M9 for pgadmin-hackers@arkaria.postgresql.org; Tue, 26 Nov 2019 03:37:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iZRfT-0002HE-Dw for pgadmin-hackers@arkaria.postgresql.org; Tue, 26 Nov 2019 03:37:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iZRfS-0001vv-PR for pgadmin-hackers@lists.postgresql.org; Tue, 26 Nov 2019 03:37:35 +0000 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iZRfP-0005TA-7A for pgadmin-hackers@postgresql.org; Tue, 26 Nov 2019 03:37:33 +0000 Received: by mail-io1-xd2a.google.com with SMTP id u24so17161231iob.5 for ; Mon, 25 Nov 2019 19:37:31 -0800 (PST) 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 :cc; bh=/q4jzT8KVnuSlmUf6qZnI5RMTDG5URZNHVuFMdpGZI0=; b=NNMraWWUFCs0uGGXztwxOJdDi2kexLH9zynH/ULerMvMNSkwmT1vYziQXvgAjdpjZr XtLtMsI680jI/Dvx6FtpRMGmXD35aK9Ebu42Z+05+bVQSx72jaB2x79910g/lP3p0HIg tPU5jE6Lp1d7/wvPipxf7L2wmP9+pQDg9xotn7bSMATJ4i4OowxcXRaG15EiEGO1zEoG 8rqs4rEPOTXly+l0LxHxP4sjzHi9owmG3BUhJN8mEbWamqi0r/HS/cpVqKjmtXgqfNPC bN2skRpyT0pt1/8snpt6ylEJaUQn3aasvj9IxzcdshSOGlR6MRoASxiT98HOs0CQtziA RqIw== 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=/q4jzT8KVnuSlmUf6qZnI5RMTDG5URZNHVuFMdpGZI0=; b=rgi2bAWf5FDpoIkU4QVjfeuskoV+qKvKL3XnLlOzH6l6CaRx4zEZE2JdzZq3GjeqLI PEuq/NuPPyAw9gNBIBw2u6iBJF6yT2QZj2MuvjgqHAySTSFN2ASUe6BCOdKNebEoLDEX mjgoIwt5EwrqinKe46QfxKcQ34MaT/xwmJ465VcLaaDFGLKcuulB6/5qNASaiLCphChl G1x1pf8+u9HJOg4gRfCWn9K9730SaUl0paEHceKNHGjl3jE/xrRayWp0Bfvb/T/TRiAe PiVNAg1qjpnV3Op8TuDsiRbDxyUQK5mUrQWZbR4Hh74/rWsZSirUCXJ6ns9JdYnn3X9o 1DrQ== X-Gm-Message-State: APjAAAXOVQajIuAE0mfkVQHnZP3EQ7mCiWnV18Gn+TxNy7jwxHLU+RJy s5nL/TBYqRUtpVmZGWUs6CGUn0dP3d7S3giuzzwn/Q/lwgja1KDIHknzytRGRU0odJrdTZUcYHR Wp98BI4iwKumG7z1e7NzqdBmdcSOwM11lC3eLt4pNBuUUSZBHcj3lEeRv9Ak0FOcXn0GMVlIAx2 D1P+Wp95Y9NTRpVthtimbwug+V0T7Tu4mdk2Yr3U/lTaosfkh7X/IpBw== X-Google-Smtp-Source: APXvYqwi9ie/Fmz4IWdiSkb06YQ7PMHzfXZZW5zxJZ/OpcJbLeQt+9BEetg0mZiDu4tkQB4nF4H3/+OnRAK52L/EXAU= X-Received: by 2002:a6b:fc09:: with SMTP id r9mr31029722ioh.176.1574739450156; Mon, 25 Nov 2019 19:37:30 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Akshay Joshi Date: Tue, 26 Nov 2019 09:07:18 +0530 Message-ID: Subject: Re: [pgAdmin][RM4818] Unable to handle loss of connection to server To: Aditya Toshniwal Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="0000000000008a7c400598379970" X-CLOUD-SEC-AV-Info: edb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --0000000000008a7c400598379970 Content-Type: text/plain; charset="UTF-8" Thanks, patch applied. On Mon, Nov 25, 2019 at 12:37 PM Aditya Toshniwal < aditya.toshniwal@enterprisedb.com> wrote: > Hi Hackers, > > Attached is the updated patch to fix the review comments. > > On Thu, Nov 21, 2019 at 4:48 PM Akshay Joshi < > akshay.joshi@enterprisedb.com> wrote: > >> Hi Aditya >> >> Following are the review comments: >> >> >> - Update the timeout in the comment section from 30 seconds to 10 >> seconds in aff1436e3c8c_.py. >> >> >> - Asking for the database server password even if it is saved. >> Reproduction steps: >> >> >> - Connect to the database server, saved the password. >> - Disabled the network. Try to connect to the database server. >> - Enable the network, try to connect to the database server. >> >> >> - No error/spinner visible on GUI when the database server is >> connected using SSH Tunnel. Reproduction steps: >> >> >> - Connect to the database server with SSH Tunnel, saved both the >> password. >> - Disabled the network and Reset the Layout. >> - Expand the Servers node and try to connect the same database >> server. >> >> >> On Thu, Nov 21, 2019 at 11:58 AM Aditya Toshniwal < >> aditya.toshniwal@enterprisedb.com> wrote: >> >>> Hi, >>> >>> I forgot to mention, I've also changed the dashboard code. The dashboard >>> was sending graph data requests, but when the server lost connection the >>> requests remains pending for longer time. Because of this the server gets >>> flooded with lot of pending request and in turn slowing down the entire >>> application. >>> Code is changed so that only a certain number of requests remain pending >>> (currently 3), above which the request won't be sent. >>> >>> On Thu, Nov 21, 2019 at 11:50 AM Aditya Toshniwal < >>> aditya.toshniwal@enterprisedb.com> wrote: >>> >>>> Hi Hackers, >>>> >>>> Attached is the updated patch to fix the review comments. >>>> Please note, there is some problem with psycopg2/libpq where it hangs >>>> when network is lost - https://github.com/psycopg/psycopg2/issues/561 >>>> I've also changed the code to make connections after the "Servers" node >>>> is expanded to fix - RM4933, so that the servers are listed first. >>>> >>>> Kindly review. >>>> >>>> On Fri, Nov 15, 2019 at 2:34 PM Akshay Joshi < >>>> akshay.joshi@enterprisedb.com> wrote: >>>> >>>>> Hi Aditya >>>>> >>>>> Following are the review comments: >>>>> >>>>> 1. The default connection timeout should be *10* seconds. >>>>> 2. In case the network is disabled and when we expand the >>>>> "Servers" node the database server(for which network is disabled) should be >>>>> shown in the disconnected state. >>>>> 3. For the above case when you try to connect to the server and >>>>> at the same time trying to fetch the properties of the valid database >>>>> server, it takes long time to fetch it. >>>>> 4. Case when the network is disabled, the database servers >>>>> password is saved and pgAdmin4 tries to connect the server, after >>>>> connection timeout, there is no message to the user, only spinner gets >>>>> disappeared. We should show a message. >>>>> 5. We should improve the error messages "timeout expired" and >>>>> "Connection to the servers has been lost." to the more meaningful messages >>>>> like "Check the network settings, check the firewall status." >>>>> 6. Install database server on Windows and Enable Windows Firewall. >>>>> Try to connect to the same database server. Spinner is not showing, as a >>>>> user I am not able to understand is there any action started at the backend >>>>> or not. As a user, I'll keep trying to connect multiple times and after the >>>>> connection timeout of each request dialog pops up. >>>>> >>>>> >>>>> On Thu, Nov 14, 2019 at 12:15 PM Aditya Toshniwal < >>>>> aditya.toshniwal@enterprisedb.com> wrote: >>>>> >>>>>> Hi Hackers, >>>>>> >>>>>> Attached is the workaround patch to set the default connection >>>>>> timeout to 30 seconds instead of the current value of infinite - 0, zero. >>>>>> The input is present in the server properties dialogs advanced tab. The >>>>>> workaround applies to the RM4724 as well. >>>>>> The permanent solution would be to expand the nodes asynchronously - >>>>>> https://redmine.postgresql.org/issues/4933 >>>>>> >>>>>> Also fixed a bug where sql editor is not closing if the server is >>>>>> disconnected in between. >>>>>> >>>>>> Kindly review. >>>>>> >>>>>> -- >>>>>> Thanks and Regards, >>>>>> Aditya Toshniwal >>>>>> Sr. Software Engineer | EnterpriseDB India | Pune >>>>>> "Don't Complain about Heat, Plant a TREE" >>>>>> >>>>> >>>>> >>>>> -- >>>>> *Thanks & Regards* >>>>> *Akshay Joshi* >>>>> >>>>> *Sr. Software Architect* >>>>> *EnterpriseDB Software India Private Limited* >>>>> *Mobile: +91 976-788-8246* >>>>> >>>> >>>> >>>> -- >>>> Thanks and Regards, >>>> Aditya Toshniwal >>>> Sr. Software Engineer | EnterpriseDB India | Pune >>>> "Don't Complain about Heat, Plant a TREE" >>>> >>> >>> >>> -- >>> Thanks and Regards, >>> Aditya Toshniwal >>> Sr. Software Engineer | EnterpriseDB India | Pune >>> "Don't Complain about Heat, Plant a TREE" >>> >> >> >> -- >> *Thanks & Regards* >> *Akshay Joshi* >> >> *Sr. Software Architect* >> *EnterpriseDB Software India Private Limited* >> *Mobile: +91 976-788-8246* >> > > > -- > Thanks and Regards, > Aditya Toshniwal > Sr. Software Engineer | EnterpriseDB India | Pune > "Don't Complain about Heat, Plant a TREE" > -- *Thanks & Regards* *Akshay Joshi* *Sr. Software Architect* *EnterpriseDB Software India Private Limited* *Mobile: +91 976-788-8246* --0000000000008a7c400598379970 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks, patch applied.

On Mon, Nov 25, 2019 at 12:37 PM Adi= tya Toshniwal <adit= ya.toshniwal@enterprisedb.com> wrote:
Hi Hackers,

Attached is the= updated patch to fix the review comments.

On Thu, Nov 21, 2019 at 4:4= 8 PM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi=C2=A0Aditya<= div>
Following are the review comments:

  • Update the timeout in the comment section from 30 seconds t= o 10 seconds in=C2=A0aff1436e3c8c_.py.=C2=A0
    =
  • Asking for the database server password even if=C2=A0it is saved. Repro= duction steps:
    • Connect to the = database server, saved the password.
    • Disabled the network. Try to c= onnect=C2=A0to the database server.
    • Enable the network, try to conn= ect to the database server.
  • No error/spinner vi= sible on GUI when the database server is connected using SSH Tunnel. Reprod= uction steps:
    • Connect to the d= atabase server with SSH Tunnel, saved both the password.
    • Disabled t= he network and Reset the Layout.
    • Expand the Servers node and try to= connect the same database server.=C2=A0

On Thu, Nov 21= , 2019 at 11:58 AM Aditya Toshniwal <aditya.toshniwal@enterprisedb.com&g= t; wrote:
Hi,

I forgot to mention, I've also changed the dashboard cod= e. The dashboard was sending graph data requests, but when the server lost = connection the requests remains pending for longer time. Because of this th= e server gets flooded with lot of pending request and in turn slowing down = the entire application.
Code is changed so that only a certain number of re= quests remain pending (currently 3), above which the request won't be s= ent.

On Thu, Nov 21, 2019 at 11:50 AM Aditya Toshniwal <aditya.toshniwa= l@enterprisedb.com> wrote:
Hi Hackers,

Attache= d is the updated patch to fix the review comments.
Please note, there is so= me problem with psycopg2/libpq where it hangs when network is lost -=C2=A0<= a href=3D"https://github.com/psycopg/psycopg2/issues/561" style=3D"font-fam= ily:Arial,Helvetica,sans-serif" target=3D"_blank">https://github.com/psycop= g/psycopg2/issues/561
I've also changed the code to make connection= s after the "Servers" node is expanded to fix - RM4933, so that t= he servers are listed first.

Kindly review.

On Fri, Nov 15, 201= 9 at 2:34 PM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi=C2= =A0Aditya

Following are the review comments:
    The default connection timeout should be 10 seconds.
  1. In cas= e the network is disabled and when we expand the "Servers" node t= he database server(for which network is disabled) should be shown in the di= sconnected state.
  2. =C2=A0For the above case when you try to connect = to the server and at the same time trying to fetch the properties of the va= lid database server, it takes long time to fetch it.
  3. =C2=A0Case whe= n the network is disabled, the database servers password is saved and pgAdm= in4 tries to connect the server, after connection timeout, there is no mess= age to the user, only spinner gets disappeared. We should show a message.
  4. We should improve the error messages "timeout expired" and= "Connection to the servers has been lost." to the more meaningfu= l messages like "Check the network settings, check the firewall=C2=A0s= tatus."
  5. Install database server on Windows and Enable Windows = Firewall. Try to connect to the same database server. Spinner is not showin= g, as a user I am not able to understand is there any action started at the= backend or not. As a user, I'll keep trying to connect multiple times = and after the connection timeout of each request dialog pops up.
<= /div>

On Thu, Nov 14, 2019 at 12:15 PM Aditya Toshniwal <aditya.toshniw= al@enterprisedb.com> wrote:
Hi Hackers,

<= /div>
Attached is the workarou= nd patch to set the default connection timeout to 30 seconds instead of the= current value of infinite - 0, zero. The input is present in the server pr= operties dialogs advanced tab. The workaround applies to the RM4724 as well= .
The permanent solution= would be to expand the nodes asynchronously -=C2=A0https://redmine.postgresql.org/issues/4933

Also fixed a bug where sql editor is not closin= g if the server is disconnected in between.

Kindly review.

--
Thanks and Regards= ,
Aditya Toshniwal
Sr. Softwa= re Engineer |=C2=A0EnterpriseDB India |=C2=A0Pune
"Don't Complain about Heat, Pl= ant a TREE"


--
Thanks & Regards
Akshay Joshi
<= font color=3D"#3333FF">Sr. Software Architect=
<= font color=3D"#000000" face=3D"arial, sans-serif">EnterpriseDB Software = India Private Limited
Mobile: +91 976-788-8246=


--
Th= anks and Regards,
Aditya = Toshniwal
Sr. Software Engineer |=C2=A0EnterpriseDB India |=C2=A0Pune
"Don't Complain a= bout Heat, Plant a TREE"


--
Th= anks and Regards,
Aditya = Toshniwal
Sr. Software Engineer |=C2=A0EnterpriseDB India |=C2=A0Pune
"Don't Complain a= bout Heat, Plant a TREE"


--
Thanks & Regards
Akshay Joshi
<= font color=3D"#3333FF">Sr. Software Architect=
<= font color=3D"#000000" face=3D"arial, sans-serif">EnterpriseDB Software = India Private Limited
Mobile: +91 976-788-8246=


--
Th= anks and Regards,
Aditya = Toshniwal
Sr. Software Engineer |=C2=A0EnterpriseDB India |=C2=A0Pune
"Don't Complain a= bout Heat, Plant a TREE"


--
Thanks & Regards
=
Akshay Joshi
Sr. Software Architect
EnterpriseDB Software India Private Limited
=
Mobile: += 91 976-788-8246
--0000000000008a7c400598379970--