Ver código fonte

HPCC-19477 Unreadable file metadata should not be fatal

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 7 anos atrás
pai
commit
6031071afc
2 arquivos alterados com 28 adições e 16 exclusões
  1. 27 15
      common/thorhelper/thorcommon.cpp
  2. 1 1
      rtl/include/eclhelper.hpp

+ 27 - 15
common/thorhelper/thorcommon.cpp

@@ -1963,26 +1963,38 @@ void bindMemoryToLocalNodes()
 
 extern THORHELPER_API IOutputMetaData *getDaliLayoutInfo(IPropertyTree const &props)
 {
-    bool isGrouped = props.getPropBool("@grouped", false);
-    if (props.hasProp("_rtlType"))
+    try
     {
-        MemoryBuffer layoutBin;
-        props.getPropBin("_rtlType", layoutBin);
-        return createTypeInfoOutputMetaData(layoutBin, isGrouped, nullptr);
-    }
-    else if (props.hasProp("ECL"))
-    {
-        StringBuffer layoutECL;
-        props.getProp("ECL", layoutECL);
-        MultiErrorReceiver errs;
-        Owned<IHqlExpression> expr = parseQuery(layoutECL.str(), &errs);
-        if (errs.errCount() == 0)
+        bool isGrouped = props.getPropBool("@grouped", false);
+        if (props.hasProp("_rtlType"))
         {
             MemoryBuffer layoutBin;
-            if (exportBinaryType(layoutBin, expr))
-                return createTypeInfoOutputMetaData(layoutBin, isGrouped, nullptr);
+            props.getPropBin("_rtlType", layoutBin);
+            return createTypeInfoOutputMetaData(layoutBin, isGrouped, nullptr);
+        }
+        else if (props.hasProp("ECL"))
+        {
+            StringBuffer layoutECL;
+            props.getProp("ECL", layoutECL);
+            MultiErrorReceiver errs;
+            Owned<IHqlExpression> expr = parseQuery(layoutECL.str(), &errs);
+            if (errs.errCount() == 0)
+            {
+                MemoryBuffer layoutBin;
+                if (exportBinaryType(layoutBin, expr))
+                    return createTypeInfoOutputMetaData(layoutBin, isGrouped, nullptr);
+            }
         }
     }
+    catch (IException *E)
+    {
+        EXCLOG(E, "Cannot deserialize file metadata:");
+        ::Release(E);
+    }
+    catch (...)
+    {
+        DBGLOG("Cannot deserialize file metadata: Unknown error");
+    }
     return nullptr;
 }
 

+ 1 - 1
rtl/include/eclhelper.hpp

@@ -337,7 +337,7 @@ const char xpathCompoundSeparatorChar = (char)1;
 
 enum RtlFieldTypeMask
 {
-    RFTMkind                = 0x000000ff,                   // values are defined in deftype.hpp
+    RFTMkind                = 0x000000ff,                   // values are defined in rtlconst.hpp
     RFTMunsigned            = 0x00000100,                   // numeric types only.
     RFTMebcdic              = 0x00000100,                   // strings only
     RFTMlinkcounted         = 0x00000200,                   // datasets, rows and records only.  But possibly strings etc. later...