Browse Source

Merge remote-tracking branch 'origin/candidate-3.10.x' into candidate-4.0.0

Conflicts:
	roxie/ccd/ccd.hpp
	roxie/ccd/ccdmain.cpp
	roxie/ccd/ccdstate.cpp

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 years ago
parent
commit
6100ee0269
4 changed files with 25 additions and 1 deletions
  1. 1 0
      roxie/ccd/ccd.hpp
  2. 18 1
      roxie/ccd/ccdmain.cpp
  3. 4 0
      roxie/ccd/ccdqueue.cpp
  4. 2 0
      roxie/ccd/ccdstate.cpp

+ 1 - 0
roxie/ccd/ccd.hpp

@@ -448,6 +448,7 @@ inline unsigned getBondedChannel(unsigned partNo)
 extern void FatalError(const char *format, ...)  __attribute__((format(printf, 1, 2)));
 extern unsigned getNextInstanceId();
 extern void closedown();
+extern void saveTopology();
 
 #define LOGGING_INTERCEPTED     0x01
 #define LOGGING_TIMEACTIVITIES  0x02

+ 18 - 1
roxie/ccd/ccdmain.cpp

@@ -88,6 +88,7 @@ unsigned udpMulticastBufferSize = 262142;
 bool roxieMulticastEnabled = true;
 
 IPropertyTree* topology;
+StringBuffer topologyFile;
 CriticalSection ccdChannelsCrit;
 IPropertyTree* ccdChannels;
 StringArray allQuerySetNames;
@@ -401,6 +402,23 @@ int myhook(int alloctype, void *, size_t nSize, int p1, long allocSeq, const uns
 }
 #endif
 
+void saveTopology()
+{
+    // Write back changes that have been made via certain control:xxx changes, so that they survive a roxie restart
+    // Note that they are overwritten when Roxie is manually stopped/started via hpcc-init service - these changes
+    // are only intended to be temporary for the current session
+    try
+    {
+        saveXML(topologyFile.str(), topology);
+    }
+    catch (IException *E)
+    {
+        // If we can't save the topology, then tough. Carry on without it. Changes will not survive an unexpected roxie restart
+        EXCLOG(E, "Error saving topology file");
+        E->Release();
+    }
+}
+
 int STARTQUERY_API start_query(int argc, const char *argv[])
 {
     EnableSEHtoExceptionMapping();
@@ -482,7 +500,6 @@ int STARTQUERY_API start_query(int argc, const char *argv[])
         Owned<IFile> sentinelFile = createSentinelTarget();
         removeSentinelFile(sentinelFile);
 
-        StringBuffer topologyFile;
         if (globals->hasProp("--topology"))
             globals->getProp("--topology", topologyFile);
         else

+ 4 - 0
roxie/ccd/ccdqueue.cpp

@@ -1711,7 +1711,11 @@ public:
         int udpQueueSize = topology->getPropInt("@udpQueueSize", UDP_QUEUE_SIZE);
         int udpSendQueueSize = topology->getPropInt("@udpSendQueueSize", UDP_SEND_QUEUE_SIZE);
         int udpMaxSlotsPerClient = topology->getPropInt("@udpMaxSlotsPerClient", 0x7fffffff);
+#ifdef _DEBUG
         bool udpResendEnabled = topology->getPropBool("@udpResendEnabled", false);
+#else
+        bool udpResendEnabled = false;  // As long as it is known to be broken, we don't want it accidentally enabled in any release version
+#endif
         openReceiveSocket();
         maxPacketSize = sock->get_max_send_size();
         if ((maxPacketSize==0)||(maxPacketSize>65535))

+ 2 - 0
roxie/ccd/ccdstate.cpp

@@ -1779,6 +1779,7 @@ private:
                 topology->setPropBool("@lockDali", true);
                 if (daliHelper)
                     daliHelper->disconnect();
+                saveTopology();
             }
             else if (stricmp(queryName, "control:logfullqueries")==0)
             {
@@ -2246,6 +2247,7 @@ private:
             {
                 topology->setPropBool("@lockDali", false);
                 // Dali will reattach via the timer that checks every so often if can reattach...
+                saveTopology();
             }
             else if (stricmp(queryName, "control:unsuspend")==0)
             {