Browse Source

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

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 years ago
parent
commit
8bf3ed4e30

+ 3 - 0
common/remote/rmtspawn.cpp

@@ -467,9 +467,12 @@ void CRemoteSlave::run(int argc, char * argv[])
                     msg.clear();
                     if (catchReadBuffer(masterSocket, msg, RMTTIME_RESPONSE_MASTER))
                     {
+                        LOG(MCdebugProgress, unknownJob, "Terminate acknowledgement received from master for slave %d", info.replyTag);
                         msg.read(ok);
                         assertex(ok);
                     }
+                    else
+                        LOG(MCdebugProgress, unknownJob, "No terminate acknowledgement received from master for slave %d", info.replyTag);
 
                     if (error)
                         break;

+ 7 - 0
common/remote/rmtssh.cpp

@@ -531,6 +531,13 @@ public:
             while (res.length()&&(res.charAt(res.length()-1)<=' '))
                 res.setLength(res.length()-1);
             PROGLOG("%s result(%d):\n%s",useplink?"plink":"ssh",reply.item(0),res.str());
+            if (res.length())
+            {
+                int code = reply.item(0);
+                if (code == 0)
+                    code = -1;
+                throw MakeStringExceptionDirect(code, res.str());
+            }
         }
     }
     void exec(

+ 1 - 1
dali/dfu/dfurun.cpp

@@ -166,7 +166,7 @@ class CDFUengine: public CInterface, implements IDFUengine
                 PROGLOG("ABORT notified");
             abort = true;
         }
-    } abortnotify;
+    };
 
 
     class cDFUlistener: public Thread

+ 11 - 2
dali/ft/filecopy.cpp

@@ -2529,8 +2529,14 @@ void FileSprayer::waitForTransferSem(Semaphore & sem)
             StringBuffer list;
             ForEachItemIn(i, transferSlaves)
                 transferSlaves.item(i).logIfRunning(list);
+
             if (timeSinceProgress>RESPONSE_TIME_TIMEOUT)
-                throwError1(RFSERR_TimeoutWaitSlave, list.str());
+            {
+                //Set an error - the transfer threads will check it after a couple of minutes, and then terminate gracefully
+                CriticalBlock lock(errorCS);
+                if (!error)
+                    error.setown(MakeStringException(RFSERR_TimeoutWaitSlave, RFSERR_TimeoutWaitSlave_Text, list.str()));
+            }
         }
     }
 }
@@ -2545,7 +2551,10 @@ void FileSprayer::addTarget(unsigned idx, INode * node)
 }
 
 bool FileSprayer::isAborting()
-{ 
+{
+    if (aborting || error)
+        return true;
+
     unsigned nowTick = msTick();
     if (abortChecker && (nowTick - lastAbortCheckTick >= abortCheckFrequency))
     {

+ 16 - 27
esp/services/ws_ecl/ws_ecl_service.cpp

@@ -535,26 +535,21 @@ static void buildReqXml(StringStack& parent, IXmlType* type, StringBuffer& out,
             return; // recursive
 
         int startlen = out.length();
-        out.appendf("<%s", tag);
+        appendXMLOpenTag(out, tag, NULL, false);
         if (ns)
             out.append(' ').append(ns);
         int taglen=out.length()+1;
         for (size_t i=0; i<type->getAttrCount(); i++)
         {
             IXmlAttribute* attr = type->queryAttr(i);
+            StringBuffer s;
+            const char *attrval;
             if (parmtree)
-            {
-                StringBuffer attrpath("@");
-                const char *attrval = parmtree->queryProp(attrpath.append(attr->queryName()).str());
-                if (attrval)
-                    out.appendf(" %s='", attr->queryName()).append(attrval);
-            }
+                attrval = parmtree->queryProp(s.append('@').append(attr->queryName()));
             else
-            {
-                out.appendf(" %s='", attr->queryName());
-                attr->getSampleValue(out);
-            }
-            out.append('\'');
+                attrval = attr->getSampleValue(s);
+            if (attrval)
+                appendXMLAttr(out, attr->queryName(), attrval);
         }
         out.append('>');
         if (typeName)
@@ -567,9 +562,9 @@ static void buildReqXml(StringStack& parent, IXmlType* type, StringBuffer& out,
             assertex(flds==0);
             if (parmtree)
             {
-                const char *attrval = parmtree->queryProp(NULL);
-                if (attrval)
-                    out.append(attrval);
+                const char *val = parmtree->queryProp(NULL);
+                if (val)
+                    encodeXML(val, out);
             }
             else if (flags & REQXML_SAMPLE_DATA)
                 type->queryFieldType(0)->getSampleValue(out,tag);
@@ -592,7 +587,7 @@ static void buildReqXml(StringStack& parent, IXmlType* type, StringBuffer& out,
         if ((flags & REQXML_TRIM) && !(flags & REQXML_ROOT) && out.length()==taglen)
             out.setLength(startlen);
         else
-            out.appendf("</%s>",tag);
+            appendXMLCloseTag(out, tag);
     }
     else if (type->isArray())
     {
@@ -608,7 +603,7 @@ static void buildReqXml(StringStack& parent, IXmlType* type, StringBuffer& out,
             parent.push_back(typeName);
 
         int startlen = out.length();
-        out.appendf("<%s", tag);
+        appendXMLOpenTag(out, tag);
         if (ns)
             out.append(' ').append(ns);
         out.append(">");
@@ -656,7 +651,7 @@ static void buildReqXml(StringStack& parent, IXmlType* type, StringBuffer& out,
         if ((flags & REQXML_TRIM) && !(flags & REQXML_ROOT) && out.length()==taglen)
             out.setLength(startlen);
         else
-            out.appendf("</%s>",tag);
+            appendXMLCloseTag(out, tag);
     }
     else // simple type
     {
@@ -672,18 +667,12 @@ static void buildReqXml(StringStack& parent, IXmlType* type, StringBuffer& out,
             {
                 if (!strieq(parmval, "default"))
                 {
-                    out.appendf("<%s>", tag);
-                    if (parmval.length())
-                        out.append((strieq(parmval.str(),"1")||strieq(parmval.str(),"true")||strieq(parmval.str(), "on")) ? '1' : '0');
-                    out.appendf("</%s>", tag);
+                    bool val = (strieq(parmval.str(),"1")||strieq(parmval.str(),"true")||strieq(parmval.str(), "on"));
+                    appendXMLTag(out, tag, val ? "1" : "0");
                 }
             }
             else
-            {
-                out.appendf("<%s>", tag);
-                out.append(parmval);
-                out.appendf("</%s>", tag);
-            }
+                appendXMLTag(out, tag, parmval);
         }
     }
 }