Browse Source

Merge branch 'candidate-6.4.18'

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 7 years ago
parent
commit
9082a03dd6

+ 1 - 1
dali/server/daldap.cpp

@@ -173,7 +173,7 @@ public:
         bool filescope = stricmp(key,"Scope")==0;
         bool wuscope = stricmp(key,"workunit")==0;
 
-        if (checkScopeScans() && (filescope || wuscope)) {
+        if (filescope || wuscope) {
             SecAccessFlags perm = SecAccess_None;
             unsigned start = msTick();
             if (filescope)

+ 11 - 9
esp/services/ws_workunits/ws_workunitsHelpers.cpp

@@ -2014,26 +2014,28 @@ void WsWuInfo::getWorkunitThorLog(const char* fileName, MemoryBuffer& buf, const
     }
 }
 
-void WsWuInfo::getWorkunitThorSlaveLog(const char *groupName, const char *ipAddress, const char* logDate,
+void WsWuInfo::getWorkunitThorSlaveLog(const char *instanceName, const char *ipAddress, const char* logDate,
     const char* logDir, int slaveNum, MemoryBuffer& buf, const char* outFile, bool forDownload)
 {
     if (isEmpty(logDir))
-      throw MakeStringException(ECLWATCH_INVALID_INPUT,"ThorSlave log path not specified.");
+        throw MakeStringException(ECLWATCH_INVALID_INPUT,"ThorSlave log path not specified.");
     if (isEmpty(logDate))
         throw MakeStringException(ECLWATCH_INVALID_INPUT,"ThorSlave log date not specified.");
 
     StringBuffer slaveIPAddress, logName;
     if (slaveNum > 0)
     {
-        if (isEmpty(groupName))
-          throw MakeStringException(ECLWATCH_INVALID_INPUT,"Thor group not specified.");
+        if (isEmpty(instanceName))
+            throw MakeStringException(ECLWATCH_INVALID_INPUT,"Thor instance not specified.");
 
-        Owned<IGroup> nodeGroup = queryNamedGroupStore().lookup(groupName);
+        StringBuffer groupName;
+        getClusterThorGroupName(groupName, instanceName);
+        if (groupName.isEmpty())
+            throw MakeStringException(ECLWATCH_INVALID_INPUT, "Failed to get Thor Group Name for %s", instanceName);
+
+        Owned<IGroup> nodeGroup = queryNamedGroupStore().lookup(groupName.str());
         if (!nodeGroup || (nodeGroup->ordinality() == 0))
-        {
-            WARNLOG("Node group %s not found", groupName);
-            return;
-        }
+            throw MakeStringException(ECLWATCH_INVALID_INPUT, "Node group %s not found", groupName.str());
 
         nodeGroup->queryNode(slaveNum-1).endpoint().getIpText(slaveIPAddress);
         if (slaveIPAddress.length() < 1)

+ 14 - 3
initfiles/sbin/hpcc_setenv.in

@@ -86,9 +86,20 @@ function pidwait_fn () {
 platform='unknown'
 unamestr=`uname`
 if [[ "$unamestr" == 'Linux' ]]; then
-   platform='linux'
+    platform='linux'
+    which nproc >/dev/null 2>&1
+    rc=$?
+    if [[ $rc -eq 0 ]] ; then
+       num_cpus=$(nproc)
+    else
+       num_cpus=$(grep -c ^processor /proc/cpuinfo 2>/dev/null)
+    fi
 elif [[ "$unamestr" == 'Darwin' ]]; then
-   platform='mac'
+    platform='mac'
+    num_cpus=$(sysctl -n hw.ncpu 2>/dev/null)
+fi
+if [[ -z "$num_cpus" ]] ; then
+    num_cpus=1
 fi
 HPCC_CONFIG=${HPCC_CONFIG:-${CONFIG_DIR}/${ENV_CONF_FILE}}
 #SECTION=${1:-DEFAULT}
@@ -103,7 +114,7 @@ umask ${OUMASK}
 
 # use less heap when threaded
 # but if set too low it can affect performance significantly
-num_arenas=$(getconf _NPROCESSORS_ONLN 2>/dev/null)
+num_arenas=$num_cpus
 if [ -z "$num_arenas" ] ; then
     num_arenas=8
 elif [ $num_arenas -lt 8 ] ; then