Browse Source

HPCC-26645 Fix Thor jobid logging

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Jake Smith 3 years ago
parent
commit
a1c7151732

+ 3 - 1
thorlcr/master/thmastermain.cpp

@@ -927,7 +927,9 @@ int main( int argc, const char *argv[]  )
             throw makeStringException(0, "missing --workunit");
         if (isEmptyString(graphName))
             throw makeStringException(0, "missing --graphName");
-        setDefaultJobId(workunit);
+        LogMsgJobId thorJobId = queryLogMsgManager()->addJobId(workunit);
+        thorJob.setJobID(thorJobId);
+        setDefaultJobId(thorJobId);
         StringBuffer thorEpStr;
         LOG(MCdebugProgress, thorJob, "ThorMaster version %d.%d, Started on %s", THOR_VERSION_MAJOR,THOR_VERSION_MINOR,thorEp.getUrlStr(thorEpStr).str());
         LOG(MCdebugProgress, thorJob, "Thor name = %s, queue = %s, nodeGroup = %s",thorname,queueName.str(),nodeGroup.str());

+ 3 - 1
thorlcr/slave/slavmain.cpp

@@ -1882,7 +1882,9 @@ public:
                         ILogMsgFilter *existingLogHandler = queryLogMsgManager()->queryMonitorFilter(logHandler);
                         dbgassertex(existingLogHandler);
                         verifyex(queryLogMsgManager()->changeMonitorFilterOwn(logHandler, getCategoryLogMsgFilter(existingLogHandler->queryAudienceMask(), existingLogHandler->queryClassMask(), maxLogDetail)));
-                        setDefaultJobId(wuid.str());
+                        LogMsgJobId thorJobId = queryLogMsgManager()->addJobId(wuid);
+                        thorJob.setJobID(thorJobId);
+                        setDefaultJobId(thorJobId);
 
                         PROGLOG("Started wuid=%s, user=%s, graph=%s [log detail level=%u]\n", wuid.get(), user.str(), graphName.get(), maxLogDetail);
                         PROGLOG("Using query: %s", soPath.str());

+ 1 - 1
thorlcr/thorutil/thormisc.cpp

@@ -784,7 +784,7 @@ void loadCmdProp(IPropertyTree *tree, const char *cmdProp)
     }
 }
 
-const LogMsgJobInfo thorJob(UnknownJob, UnknownUser); // may be improved later
+LogMsgJobInfo thorJob(UnknownJob, UnknownUser); // configured at job start (in manager and workers)
 
 void ensureDirectoryForFile(const char *fName)
 {

+ 1 - 1
thorlcr/thorutil/thormisc.hpp

@@ -110,7 +110,7 @@
 #define THOR_SEM_RETRY_TIMEOUT 2
 
 // Logging
-extern graph_decl const LogMsgJobInfo thorJob;
+extern graph_decl LogMsgJobInfo thorJob;
 
 enum ThorExceptionAction { tea_null, tea_warning, tea_abort, tea_shutdown };