[mapguide-commits] r8393 - in branches/2.6/MgDev: . Server/src/Core

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Oct 7 02:31:27 PDT 2014


Author: jng
Date: 2014-10-07 02:31:27 -0700 (Tue, 07 Oct 2014)
New Revision: 8393

Modified:
   branches/2.6/MgDev/
   branches/2.6/MgDev/Server/src/Core/ClientAcceptor.cpp
Log:
Merged revision(s) 8392 from trunk/MgDev:
#2492: Reclaim any dangling sockets on server restart. The allows for immediate server restart on Linux when it dies due to segfault. No observable side-effects on Windows.
........



Property changes on: branches/2.6/MgDev
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/2.4/MgDev:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/sandbox/jng/createruntimemap:7486-7555
/sandbox/rfc94:5099-5163
/trunk/MgDev:8209-8210,8230,8313,8333,8359,8388
   + /branches/2.4/MgDev:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/sandbox/jng/createruntimemap:7486-7555
/sandbox/rfc94:5099-5163
/trunk/MgDev:8209-8210,8230,8313,8333,8359,8388,8392

Modified: branches/2.6/MgDev/Server/src/Core/ClientAcceptor.cpp
===================================================================
--- branches/2.6/MgDev/Server/src/Core/ClientAcceptor.cpp	2014-10-07 09:29:39 UTC (rev 8392)
+++ branches/2.6/MgDev/Server/src/Core/ClientAcceptor.cpp	2014-10-07 09:31:27 UTC (rev 8393)
@@ -55,7 +55,14 @@
     // Set a large backlog so INET will not block connections
     // so often.  It takes time to clean the port up and
     // make it available for other connections.
-    if (m_SockAcceptor.open(m_Addr, 0, PF_INET, 32) != -1)
+    //
+    // Also set reuse_addr = 1 to avoid the case where the mgserver
+    // process dies by segfault and we have to wait several minutes for
+    // the dangling sockets to be cleared out by the system before mgserver
+    // can be started again (dangling sockets will cause a "port already in 
+    // use" error when restarting mgserver). With reuse_addr = 1, mgserver 
+    // will reclaim these dangling sockets when this method is called
+    if (m_SockAcceptor.open(m_Addr, 1 /* reuse_addr */, PF_INET, 32) != -1)
     {
         MgLogManager* pMan = MgLogManager::GetInstance();
         if(pMan->IsTraceLogEnabled())



More information about the mapguide-commits mailing list