]> granicus.if.org Git - icinga2/commitdiff
Fix handling of m_RequestRestart in RunEventLoop, improve reload timeout
authorGerd von Egidy <gerd@egidy.de>
Mon, 28 Apr 2014 21:30:56 +0000 (23:30 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 29 Apr 2014 08:34:02 +0000 (10:34 +0200)
Refs #5788

lib/base/application.cpp

index a3a6029051cb6b211872ba5503d72372eeedb7f7..6cef2b83f143fa6a203d01def4f126c6a7cc3327 100644 (file)
@@ -240,19 +240,19 @@ mainloop:
                }
 
                lastLoop = now;
-
-               if (m_RequestRestart) {
-                       m_RequestRestart = false;         // we are now handling the request, once is enough
+       }
                
-                       // are we already restarting? ignore request if we already are
-                       if (m_Restarting)
-                               goto mainloop;
-
-                       m_Restarting = true;
-                       StartReloadProcess();
+       if (m_RequestRestart) {
+               m_RequestRestart = false;         // we are now handling the request, once is enough
 
+               // are we already restarting? ignore request if we already are
+               if (m_Restarting)
                        goto mainloop;
-               }
+
+               m_Restarting = true;
+               StartReloadProcess();
+
+               goto mainloop;
        }
        
        Log(LogInformation, "base", "Shutting down Icinga...");
@@ -289,7 +289,7 @@ void Application::StartReloadProcess(void) const
 
        Process::Ptr process = make_shared<Process>(args);
 
-       process->SetTimeout(15);
+       process->SetTimeout(300);
 
        process->Run(boost::bind(&Application::ReloadProcessCallback, _1));
 }