public inbox for [email protected]  
help / color / mirror / Atom feed
From: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [patch][pgAdmin4] Windows error - The application server could not be contacted occasionally
Date: Tue, 1 Jan 2019 15:54:34 +0530
Message-ID: <CAM9w-_nJm3V6Fv9e7gTgVGPnqzFYUabQy5RUUP3TStUL_3J2OA@mail.gmail.com> (raw)

Hi Hackers,

Some of the windows users are facing the error as "The application server could
not be contacted" while starting pgAdmin4. The startup logs had nothing.
Just that the application timed out.
I was able to simulate the issue for sometime when I started my windows
machine, but later it did not throw any error and worked fine.
It turned out that due to the slowness of the Windows OS initially the
application took time to setup which was longer than the app start timeout
- 30secs and so, timed out.
In the attached patch, I have increased the timeout to 90secs (difficult to
figure out the standard timeout). Plus, I have changed the messages at
intervals when the app is starting so that it does not look stuck.

Kindly review.

-- 
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB Software Solutions | Pune
"Don't Complain about Heat, Plant a tree"


Attachments:

  [application/octet-stream] timeout.splash.patch (1.5K, 3-timeout.splash.patch)
  download | inline diff:
diff --git a/runtime/pgAdmin4.cpp b/runtime/pgAdmin4.cpp
index 471cb50f..b9a5a219 100644
--- a/runtime/pgAdmin4.cpp
+++ b/runtime/pgAdmin4.cpp
@@ -347,12 +347,14 @@ int main(int argc, char * argv[])
     Logger::GetLogger()->Log(QString(QWidget::tr("Application Server URL: %1")).arg(appServerUrl));
 
     // Read the server connection timeout from the registry or set the default timeout.
-    int timeout = settings.value("ConnectionTimeout", 30).toInt();
+    int timeout = settings.value("ConnectionTimeout", 90).toInt();
 
     // Now the server should be up, we'll attempt to connect and get a response.
     // We'll retry in a loop a few time before aborting if necessary.
 
     QTime endTime = QTime::currentTime().addSecs(timeout);
+    QTime midTime1 = QTime::currentTime().addSecs(timeout/3);
+    QTime midTime2 = QTime::currentTime().addSecs(timeout*2/3);
     bool alive = false;
 
     Logger::GetLogger()->Log("The server should be up, we'll attempt to connect and get a response. Ping the server");
@@ -365,6 +367,17 @@ int main(int argc, char * argv[])
             break;
         }
 
+        if(QTime::currentTime() >= midTime1)
+        {
+            if(QTime::currentTime() < midTime2) {
+                splash->showMessage(QString(QWidget::tr("Taking longer than usual...")), Qt::AlignBottom | Qt::AlignCenter);
+            }
+            else
+            {
+                splash->showMessage(QString(QWidget::tr("Almost there...")), Qt::AlignBottom | Qt::AlignCenter);
+            }
+        }
+
         delay(200);
     }
 


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [patch][pgAdmin4] Windows error - The application server could not be contacted occasionally
  In-Reply-To: <CAM9w-_nJm3V6Fv9e7gTgVGPnqzFYUabQy5RUUP3TStUL_3J2OA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox