Browse Source

Merge pull request #3943 from richardkchapman/roxie-closedown

HPCC-8773 Add a control:closedown command to Roxie

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 12 years ago
parent
commit
047445517c
3 changed files with 12 additions and 0 deletions
  1. 1 0
      roxie/ccd/ccd.hpp
  2. 7 0
      roxie/ccd/ccdmain.cpp
  3. 4 0
      roxie/ccd/ccdstate.cpp

+ 1 - 0
roxie/ccd/ccd.hpp

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

+ 7 - 0
roxie/ccd/ccdmain.cpp

@@ -250,6 +250,13 @@ public:
     }
 } waiter;
 
+void closedown()
+{
+    Owned<IFile> sentinelFile = createSentinelTarget();
+    removeSentinelFile(sentinelFile);
+    waiter.onAbort();
+}
+
 void getAccessList(const char *aclName, IPropertyTree *topology, IPropertyTree *serverInfo)
 {
     StringBuffer xpath;

+ 4 - 0
roxie/ccd/ccdstate.cpp

@@ -1384,6 +1384,10 @@ private:
                 bool clearAll = control->getPropBool("@clearAll", true);
                 clearKeyStoreCache(clearAll);
             }
+            else if (stricmp(queryName, "control:closedown")==0)
+            {
+                closedown();
+            }
             else if (stricmp(queryName, "control:closeExpired")==0)
             {
                 queryFileCache().closeExpired(false);