浏览代码

Merge branch 'candidate-8.4.x'

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 年之前
父节点
当前提交
ba99f88ba7

+ 1 - 2
cmake_modules/commonSetup.cmake

@@ -70,12 +70,11 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
   option(USE_AZURE "Configure use of azure" ON)
   option(USE_H3 "Configure use of Uber H3 geospatial indexing" ON)
   option(USE_NLP "Configure use of NLP++ engine" ON)
+  option(USE_GIT "Configure use of GIT (Hooks)" ON)
   if (WIN32)
     option(USE_AERON "Include the Aeron message protocol" OFF)
-    option(USE_GIT "Configure use of GIT (Hooks)" OFF)
   else()
     option(USE_AERON "Include the Aeron message protocol" ON)
-    option(USE_GIT "Configure use of GIT (Hooks)" ON)
   endif()
   option(USE_LIBARCHIVE "Configure use of libarchive" ON)
   option(USE_URIPARSER "Configure use of uriparser" OFF)

+ 2 - 2
common/workunit/workunit.cpp

@@ -12527,9 +12527,9 @@ extern WUState waitForWorkUnitToComplete(const char * wuid, int timeout, std::li
     return globalFactory->waitForWorkUnit(wuid, (unsigned) timeout, false, expectedStates);
 }
 
-extern WORKUNIT_API WUState secWaitForWorkUnitToComplete(const char * wuid, ISecManager &secmgr, ISecUser &secuser, int timeout, std::list<WUState> expectedStates)
+extern WORKUNIT_API WUState secWaitForWorkUnitToComplete(const char * wuid, ISecManager *secmgr, ISecUser *secuser, int timeout, std::list<WUState> expectedStates)
 {
-    if (checkWuSecAccess(wuid, &secmgr, &secuser, SecAccess_Read, "Wait for Complete", false, true))
+    if (checkWuSecAccess(wuid, secmgr, secuser, SecAccess_Read, "Wait for Complete", false, true))
         return waitForWorkUnitToComplete(wuid, timeout, expectedStates);
     return WUStateUnknown;
 }

+ 1 - 1
common/workunit/workunit.hpp

@@ -1635,7 +1635,7 @@ inline bool isWorkunitDAToken(const char * distributedAccessToken)
 //returns a state code.  WUStateUnknown == timeout
 extern WORKUNIT_API WUState waitForWorkUnitToComplete(const char * wuid, int timeout = -1, std::list<WUState> expectedStates = {});
 extern WORKUNIT_API bool waitForWorkUnitToCompile(const char * wuid, int timeout = -1);
-extern WORKUNIT_API WUState secWaitForWorkUnitToComplete(const char * wuid, ISecManager &secmgr, ISecUser &secuser, int timeout = -1, std::list<WUState> expectedStates = {});
+extern WORKUNIT_API WUState secWaitForWorkUnitToComplete(const char * wuid, ISecManager *secmgr, ISecUser *secuser, int timeout = -1, std::list<WUState> expectedStates = {});
 extern WORKUNIT_API bool secWaitForWorkUnitToCompile(const char * wuid, ISecManager &secmgr, ISecUser &secuser, int timeout = -1);
 extern WORKUNIT_API bool secDebugWorkunit(const char * wuid, ISecManager &secmgr, ISecUser &secuser, const char *command, StringBuffer &response);
 extern WORKUNIT_API WUState getWorkUnitState(const char* state);

+ 26 - 6
dali/dalistop/dalistop.cpp

@@ -17,32 +17,52 @@
 
 #include "platform.h"
 #include "jlib.hpp"
+#include "jfile.hpp"
 #include "jmisc.hpp"
 #include "mpbase.hpp"
 #include "mpcomm.hpp"
 #include "daclient.hpp"
 
 
-int main(int argc, char* argv[])
+int main(int argc, const char* argv[])
 {
     InitModuleObjects();
     int exitCode = 1;
     try
     {
+        unsigned port = 0;
+        const char *server = nullptr;
         if (argc<2)
         {
-            printf("usage: dalistop <server_ip:port> [/nowait]\n");
-            printf("eg:  dalistop .                          -- stop dali server running locally\n");
-            printf("     dalistop eq0001016                  -- stop dali server running remotely\n");
+            // with no args, use port from daliconfig if present (used by init scripts)
+            Owned<IFile> daliConfigFile = createIFile("daliconf.xml");
+            if (daliConfigFile->exists())
+            {
+                Owned<IPropertyTree> daliConfig = createPTree(*daliConfigFile, ipt_caseInsensitive);
+                port = daliConfig->getPropInt("@port", DALI_SERVER_PORT);
+                server = ".";
+            }
+            else
+            {
+                printf("usage: dalistop <server_ip:port> [/nowait]\n");
+                printf("eg:  dalistop .                          -- stop dali server running locally\n");
+                printf("     dalistop eq0001016                  -- stop dali server running remotely\n");
+            }
         }
         else
         {
+            server = argv[1];
+            port = DALI_SERVER_PORT;
+        }
+
+        if (server)
+        {
             SocketEndpoint ep;
-            ep.set(argv[1],DALI_SERVER_PORT);
+            ep.set(server, port);
             bool nowait = false;
             if (argc>=3)
                 nowait = stricmp(argv[2],"/nowait")==0;
-            printf("Stopping Dali Server on %s\n",argv[1]);
+            printf("Stopping Dali Server on %s, port=%u\n", server, port);
 
             Owned<IGroup> group = createIGroup(1,&ep); 
             initClientProcess(group, DCR_DaliStop);

+ 2 - 1
dali/server/daserver.cpp

@@ -469,6 +469,7 @@ int main(int argc, const char* argv[])
         serverConfig.setown(loadConfiguration(defaultYaml, argv, "dali", "DALI", DALICONF, nullptr));
         Owned<IFile> sentinelFile = createSentinelTarget();
         removeSentinelFile(sentinelFile);
+        port = serverConfig->getPropInt("@port");
 #ifndef _CONTAINERIZED
         if (!checkCreateDaemon(argc, argv))
             return EXIT_FAILURE;
@@ -681,7 +682,7 @@ int main(int argc, const char* argv[])
         SocketEndpointArray epa;
         if (!server)
         {
-            ep.setLocalHost(DALI_SERVER_PORT);
+            ep.setLocalHost(port ? port : DALI_SERVER_PORT);
             epa.append(ep);
         }
         else

+ 3 - 1
ecl/eclcmd/eclcmd_common.cpp

@@ -378,8 +378,10 @@ bool EclCmdCommon::finalizeOptions(IProperties *globals)
     extractEclCmdOption(optServer, globals, ECLOPT_SERVER_ENV, ECLOPT_SERVER_INI, ECLOPT_SERVER_DEFAULT, NULL);
     extractEclCmdOption(optPort, globals, ECLOPT_PORT_ENV, ECLOPT_PORT_INI, ECLOPT_PORT_DEFAULT, NULL);
     extractEclCmdOption(optUsername, globals, ECLOPT_USERNAME_ENV, ECLOPT_USERNAME_INI, NULL, NULL);
-    extractEclCmdOption(optPassword, globals, ECLOPT_PASSWORD_ENV, ECLOPT_PASSWORD_INI, NULL, NULL);
 
+    //if an empty password was explicitly provided, optPasswordProvided would still be set
+    if (!optPasswordProvided)
+        optPasswordProvided = extractEclCmdOption(optPassword, globals, ECLOPT_PASSWORD_ENV, ECLOPT_PASSWORD_INI, NULL, NULL);
     if (!optUsername.isEmpty() && !optPasswordProvided)
     {
         VStringBuffer prompt("%s's password: ", optUsername.get());

+ 1 - 1
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -1207,7 +1207,7 @@ bool CWsWorkunitsEx::onWUWaitComplete(IEspContext &context, IEspWUWaitRequest &r
         std::list<WUState> expectedStates;
         if (req.getReturnOnWait())
             expectedStates.push_back(WUStateWait);
-        resp.setStateID(secWaitForWorkUnitToComplete(wuid.str(), *context.querySecManager(), *context.queryUser(), req.getWait(), expectedStates));
+        resp.setStateID(secWaitForWorkUnitToComplete(wuid.str(), context.querySecManager(), context.queryUser(), req.getWait(), expectedStates));
     }
     catch(IException* e)
     {

+ 2 - 2
initfiles/bin/init_dali.in

@@ -30,8 +30,8 @@ rm -f ${SENTINEL}
 
 killed()
 {
-    log "calling dalistop ."
-    dalistop .
+    log "calling dalistop"
+    dalistop
     log "Attempting to kill $component"
     dali_kill_process ${PID_NAME} daserver 3 ${SENTINEL}
     if [[ $? -eq 1 ]]; then

+ 4 - 0
initfiles/componentfiles/configxml/dali.xsl

@@ -65,6 +65,7 @@
 
 
   <xsl:variable name="daliServerNode" select="/Environment/Software/DaliServerProcess[@name=$process]"/>
+  <xsl:variable name="daliServerPort" select="/Environment/Software/DaliServerProcess[@name=$process]/Instance[1]/@port"/>
 
 
   <xsl:template match="/">
@@ -82,6 +83,9 @@
       <xsl:attribute name="name">
         <xsl:value-of select="@name"/>
       </xsl:attribute>
+      <xsl:attribute name="port">
+        <xsl:value-of select="$daliServerPort"/>
+      </xsl:attribute>
       <xsl:if test="string(@LogDir)!=''">
         <xsl:attribute name="log_dir">
           <xsl:value-of select="@LogDir"/>

+ 13 - 7
roxie/ccd/ccdfile.cpp

@@ -1710,15 +1710,21 @@ public:
                 dlfn.clearForeign();
 
             bool defaultDirPerPart = false;
-            const char *defaultDir = nullptr;
+            StringBuffer defaultDir;
 #ifdef _CONTAINERIZED
-            IFileDescriptor &fileDesc = pdesc->queryOwner();
-            defaultDir = fileDesc.queryDefaultDir();
-            FileDescriptorFlags fileFlags = static_cast<FileDescriptorFlags>(fileDesc.queryProperties().getPropInt("@flags"));
-            if (FileDescriptorFlags::none != (fileFlags & FileDescriptorFlags::dirperpart))
-                defaultDirPerPart = true;
+            if (!dlfn.isExternal())
+            {
+                IFileDescriptor &fileDesc = pdesc->queryOwner();
+                StringBuffer planeName;
+                fileDesc.getClusterGroupName(0, planeName);
+                Owned<IStoragePlane> plane = getDataStoragePlane(planeName, true);
+                defaultDir.append(plane->queryPrefix());
+                FileDescriptorFlags fileFlags = static_cast<FileDescriptorFlags>(fileDesc.queryProperties().getPropInt("@flags"));
+                if (FileDescriptorFlags::none != (fileFlags & FileDescriptorFlags::dirperpart))
+                    defaultDirPerPart = true;
+            }
 #endif
-            makePhysicalPartName(dlfn.get(), partNo, numParts, localLocation, replicationLevel, DFD_OSdefault, defaultDir, defaultDirPerPart);
+            makePhysicalPartName(dlfn.get(), partNo, numParts, localLocation, replicationLevel, DFD_OSdefault, defaultDir.str(), defaultDirPerPart);
         }
         Owned<ILazyFileIO> ret;
         try