浏览代码

Merge pull request #15777 from jakesmith/HPCC-27198-pipe-fix

HPCC-27198 Fix crash in eclccserver due to pipe->read abort handling

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 年之前
父节点
当前提交
f6af5b1f8c
共有 3 个文件被更改,包括 8 次插入8 次删除
  1. 1 1
      ecl/eclcc/eclcc.cpp
  2. 1 1
      ecl/eclccserver/eclccserver.cpp
  3. 6 6
      system/jlib/jthread.cpp

+ 1 - 1
ecl/eclcc/eclcc.cpp

@@ -541,7 +541,7 @@ int main(int argc, const char *argv[])
         queryLogMsgManager()->changeMonitorFilter(queryStderrLogMsgHandler(), filter);
 #else
         setupContainerizedLogMsgHandler();
-        bool useChildProcesses = configuration->getPropInt("@useChildProcesses", false);
+        bool useChildProcesses = configuration->getPropBool("@useChildProcesses", false);
         if (!useChildProcesses)  // If using eclcc in separate container (useChildProcesses==false),
         {                        // it will need to create a directory for gpg and import keys from secrets
             queryCodeSigner().initForContainer();

+ 1 - 1
ecl/eclccserver/eclccserver.cpp

@@ -1320,7 +1320,7 @@ int main(int argc, const char *argv[])
 #ifdef _CONTAINERIZED
             queryCodeSigner().initForContainer();
 
-            useChildProcesses = globals->getPropInt("@useChildProcesses", false);
+            useChildProcesses = globals->getPropBool("@useChildProcesses", false);
             unsigned maxThreads = globals->getPropInt("@maxActive", 4);
             childProcessTimeLimit = useChildProcesses ? 0 : globals->getPropInt("@childProcessTimeLimit", 10);
 #else

+ 6 - 6
system/jlib/jthread.cpp

@@ -1614,7 +1614,7 @@ public:
                 throw e;
             }
         }
-        return aborted?((size32_t)-1):((size32_t)sizeRead);
+        return aborted?0:((size32_t)sizeRead);
     }
     ISimpleReadStream *getOutputStream()
     {
@@ -1641,7 +1641,7 @@ public:
                 throw e;
             }
         }
-        return aborted?((size32_t)-1):((size32_t)sizeRead);
+        return aborted?0:((size32_t)sizeRead);
     }
     ISimpleReadStream *getErrorStream()
     {
@@ -2293,7 +2293,7 @@ public:
     {
         CriticalBlock block(sect); 
         if (aborted)
-            return (size32_t)-1;
+            return 0;
         if (hOutput==(HANDLE)-1)
             return 0;
         size32_t sizeRead;
@@ -2311,7 +2311,7 @@ public:
                 throw createPipeErrnoExceptionV(errno,"Pipe: read failed (size %d)", sz);
             }
         }
-        return aborted?((size32_t)-1):((size32_t)sizeRead);
+        return aborted?0:((size32_t)sizeRead);
     }
 
     ISimpleReadStream *getOutputStream()
@@ -2351,7 +2351,7 @@ public:
         if (stderrbufferthread) 
             return stderrbufferthread->read(sz,buf);
         if (aborted)
-            return (size32_t)-1;
+            return 0;
         if (hError==(HANDLE)-1)
             return 0;
         size32_t sizeRead;
@@ -2369,7 +2369,7 @@ public:
                 throw createPipeErrnoExceptionV(errno, "Pipe: readError failed (size %d)", sz);
             }
         }
-        return aborted?((size32_t)-1):((size32_t)sizeRead);
+        return aborted?0:((size32_t)sizeRead);
     }
 
     ISimpleReadStream *getErrorStream()