Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-32727 thor logging audience stage2 #19155

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions system/jlib/jlog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ typedef enum
* *
* *
* 5) For progress messages: *
* PROGLOG([LogMsgCode,] format,..) - uses MCuserProgress *
* UPROGLOG([LogMsgCode,] format,..) - uses MCuserProgress *
* *
* More general logging functions include: *
* 1) Full control over the log message: *
Expand Down Expand Up @@ -1017,6 +1017,8 @@ inline void UERRLOG(char const * format, ...)

// TODO: Remove the following #define once all ERRLOG has been removed from code
#define ERRLOG UERRLOG
// TODO: Remove the following #define once all PROGLOG has been removed from code
#define PROGLOG UPROGLOG

inline void OERRLOG(char const * format, ...) __attribute__((format(printf, 1, 2)));
inline void OERRLOG(char const * format, ...)
Expand Down Expand Up @@ -1076,8 +1078,8 @@ inline void IWARNLOG(char const * format, ...)
va_end(args);
}

inline void PROGLOG(const char * format, ...) __attribute__((format(printf, 1, 2)));
inline void PROGLOG(const char * format, ...)
inline void UPROGLOG(const char * format, ...) __attribute__((format(printf, 1, 2)));
inline void UPROGLOG(const char * format, ...)
{
va_list args;
va_start(args, format);
Expand Down Expand Up @@ -1194,8 +1196,8 @@ inline void UERRLOG(LogMsgCode code, char const * format, ...)
va_end(args);
}

inline void PROGLOG(LogMsgCode code, char const * format, ...) __attribute__((format(printf, 2, 3)));
inline void PROGLOG(LogMsgCode code, char const * format, ...)
inline void UPROGLOG(LogMsgCode code, char const * format, ...) __attribute__((format(printf, 2, 3)));
inline void UPROGLOG(LogMsgCode code, char const * format, ...)
{
va_list args;
va_start(args, format);
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/activities/diskread/thdiskreadslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ void CDiskRecordPartHandler::open()
catch (IException *e)
{
#ifdef _DEBUG
EXCLOG(e, nullptr);
DBGLOG(e);
#endif
if (remoteReadException)
e->Release(); // only record 1st
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/activities/funnel/thfunnelslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class FunnelSlaveActivity : public CSlaveActivity
exception.setown(e);
else
{
EXCLOG(e, nullptr);
DBGLOG(e);
e->Release();
}
}
Expand Down
20 changes: 11 additions & 9 deletions thorlcr/activities/hashdistrib/thhashdistribslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@

// JCSMORE should really use JLog trace levels and make configurable
#ifdef _DEBUG
#define HDSendPrintLog(M) PROGLOG(M)
#define HDSendPrintLog2(M,P1) PROGLOG(M,P1)
#define HDSendPrintLog3(M,P1,P2) PROGLOG(M,P1,P2)
#define HDSendPrintLog4(M,P1,P2,P3) PROGLOG(M,P1,P2,P3)
#define HDSendPrintLog5(M,P1,P2,P3,P4) PROGLOG(M,P1,P2,P3,P4)
#define HDSendPrintLog(M) DBGLOG(M)
#define HDSendPrintLog2(M,P1) DBGLOG(M,P1)
#define HDSendPrintLog3(M,P1,P2) DBGLOG(M,P1,P2)
#define HDSendPrintLog4(M,P1,P2,P3) DBGLOG(M,P1,P2,P3)
#define HDSendPrintLog5(M,P1,P2,P3,P4) DBGLOG(M,P1,P2,P3,P4)
#else
#define HDSendPrintLog(M)
#define HDSendPrintLog2(M,P1)
Expand Down Expand Up @@ -2291,13 +2291,15 @@ class CHDRproportional: implements IHash, public CSimpleInterface

~CHDRproportional()
{
try {
try
{
tempstrm.clear();
if (tempfile)
tempfile->remove();
}
catch (IException *e) {
EXCLOG(e,"REDISTRIBUTE");
catch (IException *e)
{
IWARNLOG(e,"REDISTRIBUTE");
e->Release();
}
free(sizes);
Expand All @@ -2323,7 +2325,7 @@ class CHDRproportional: implements IHash, public CSimpleInterface
GetTempFilePath(tempname,"hdprop");
tempfile.setown(createIFile(tempname.str()));
{
ActPrintLogEx(&activity->queryContainer(), thorlog_null, MCwarning, "REDISTRIBUTE size unknown, spilling to disk");
ActPrintLogEx(&activity->queryContainer(), thorlog_null, MCdebugWarning, "REDISTRIBUTE size unknown, spilling to disk");
MemoryAttr ma;
if (activity->getOptBool(THOROPT_COMPRESS_SPILLS, true))
{
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/activities/indexread/thindexreadslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class CIndexReadSlaveBase : public CSlaveActivity
catch (IException *e)
{
#ifdef _DEBUG
EXCLOG(e, nullptr);
DBGLOG(e);
#endif
if (remoteReadException)
e->Release(); // only record 1st
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/activities/join/thjoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class JoinActivityMaster : public CMasterActivity
{
if (e->errorCode()!=MPERR_link_closed)
throw;
ActPrintLogEx(&queryContainer(), thorlog_null, MCwarning, "WARNING: MPERR_link_closed in SortDone");
ActPrintLogEx(&queryContainer(), thorlog_null, MCdebugWarning, "WARNING: MPERR_link_closed in SortDone");
e->Release();
}
::Release(imaster);
Expand Down
11 changes: 7 additions & 4 deletions thorlcr/activities/keydiff/thkeydiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,18 @@ class CKeyDiffMaster : public CMasterActivity
Owned<IDistributedFile> patchFile;
// set part sizes etc
queryThorFileManager().publish(container.queryJob(), outputName, *patchDesc, &patchFile);
try { // set file size
if (patchFile) {
try // set file size
{
if (patchFile)
{
__int64 fs = patchFile->getFileSize(true,false);
if (fs!=-1)
patchFile->queryAttributes().setPropInt64("@size",fs);
}
}
catch (IException *e) {
EXCLOG(e,"keydiff setting file size");
catch (IException *e)
{
IERRLOG(e, "keydiff setting file size");
e->Release();
}
// Add a new 'Patch' description to the secondary key.
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/activities/keyedjoin/thkeyedjoinslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ class CKeyedJoinSlave : public CSlaveActivity, implements IJoinProcessor, implem
getInfo(errMsg);
Owned<IException> te = ThorWrapException(e, "%s", errMsg.str());
e->Release();
EXCLOG(te, nullptr);
IWARNLOG(te, nullptr);
activity.fireException(te);
}
processing.clearRows();
Expand Down
8 changes: 4 additions & 4 deletions thorlcr/activities/lookupjoin/thlookupjoinslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class CBroadcaster : public CSimpleInterface
}
catch (IException *e)
{
EXCLOG(e, "CRecv");
IWARNLOG(e, "CRecv");
abort(false);
broadcaster.cancel(e);
e->Release();
Expand Down Expand Up @@ -252,7 +252,7 @@ class CBroadcaster : public CSimpleInterface
}
catch (IException *e)
{
EXCLOG(e, "CSend");
IWARNLOG(e, "CSend");
exception.setown(e);
abort(false);
broadcaster.cancel(e);
Expand Down Expand Up @@ -951,7 +951,7 @@ class CInMemJoinBase : public CSlaveActivity, public CAllOrLookupHelper<HELPER>,
catch (IException *e)
{
exception.setown(e);
EXCLOG(e, "CRowProcessor");
IWARNLOG(e, "CRowProcessor");
owner.broadcaster->cancel(e);
}
}
Expand Down Expand Up @@ -2475,7 +2475,7 @@ class CLookupJoinActivityBase : public CInMemJoinBase<HTHELPER, IHThorHashJoinAr
}
catch (IException *e)
{
EXCLOG(e, "During channel distribution");
IWARNLOG(e, "During channel distribution");
exception.setown(e);
}

Expand Down
4 changes: 2 additions & 2 deletions thorlcr/activities/loop/thloop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ class CLoopActivityMasterBase : public CMasterActivity
}
virtual bool fireException(IException *e) override
{
EXCLOG(e, "Loop master passed exception, aborting loop graph(s)");
DBGLOG(e, "Loop master passed exception, aborting loop graph(s)");
try
{
loopGraph->abort(e);
}
catch (IException *e)
{
EXCLOG(e, "Exception whilst aborting loop graphs");
IWARNLOG(e, "Exception whilst aborting loop graphs");
e->Release();
}
return CMasterActivity::fireException(e);
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/activities/merge/thmergeslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ class GlobalMergeSlaveActivity : public CSlaveActivity
if (!r)
break;
if (pos+l>end) {
ActPrintLogEx(&queryContainer(), thorlog_null, MCwarning, "overrun in GlobalMergeSlaveActivity::getRows(%u,%" I64F "d,%" I64F "d)",l,rs->getOffset(),end);
ActPrintLogEx(&queryContainer(), thorlog_null, MCdebugWarning, "overrun in GlobalMergeSlaveActivity::getRows(%u,%" I64F "d,%" I64F "d)",l,rs->getOffset(),end);
break; // don't think should happen
}
len = l;
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/activities/msort/thmsortslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class MSortSlaveActivity : public CSlaveActivity
PARENT::stopInput(0);
if (abortSoon)
{
ActPrintLogEx(&queryContainer(), thorlog_null, MCwarning, "MSortSlaveActivity::start aborting");
ActPrintLogEx(&queryContainer(), thorlog_null, MCdebugWarning, "MSortSlaveActivity::start aborting");
barrier->cancel();
return;
}
Expand Down
4 changes: 2 additions & 2 deletions thorlcr/activities/msort/thsortu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1523,8 +1523,8 @@ class CMultiCoreJoinHelperBase: implements IJoinHelper, implements IMulticoreInt

void setException(IException *e,const char *title)
{
DBGLOG(e,title);
CriticalBlock b(sect);
EXCLOG(e,title);
if (exc.get())
e->Release();
else
Expand Down Expand Up @@ -1894,8 +1894,8 @@ class CMultiCoreUnorderedJoinHelper: public CMultiCoreJoinHelperBase
{
void setException(IException *e,const char *title)
{
DBGLOG(e,title);
CriticalBlock b(sect);
EXCLOG(e,title);
if (exc.get())
e->Release();
else
Expand Down
4 changes: 2 additions & 2 deletions thorlcr/activities/thactivityutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class CRowStreamLookAhead : public CSimpleInterfaceOf<IStartableEngineRowStream>
{
if (threaded.join(60000))
break;
PROGLOG("Still waiting on lookahead CNotifyThread thread to complete");
DBGLOG("Still waiting on lookahead CNotifyThread thread to complete");
}
}
// IThreaded impl.
Expand Down Expand Up @@ -724,7 +724,7 @@ class CWriteHandler : implements IFileIO, public CInterface
}
catch (IException *e)
{
EXCLOG(e, "CWriteHandler::beforeDispose");
DISLOG(e, "CWriteHandler::beforeDispose");
e->Release();
}
}
Expand Down
12 changes: 6 additions & 6 deletions thorlcr/activities/thdiskbaseslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void CDiskPartHandlerBase::open()
{
StringBuffer locations;
IException *e = MakeActivityException(&activity, TE_FileNotFound, "No physical file part for logical file %s, found at given locations: %s (Error = %d)", activity.logicalFilename.get(), getFilePartLocations(*partDesc, locations).str(), GetLastError());
EXCLOG(e, NULL);
IERRLOG(e, "CDiskPartHandlerBase::open()");
throw e;
}
filename.set(iFile->queryFilename());
Expand Down Expand Up @@ -438,8 +438,8 @@ void CDiskWriteSlaveActivityBase::removeFiles()
return;
Owned<IFile> primary = createIFile(fName);
try { primary->remove(); }
catch (IException *e) { ActPrintLogEx(&queryContainer(), e, thorlog_null, MCwarning, "Failed to remove file: %s", fName.get()); }
catch (CATCHALL) { ActPrintLogEx(&queryContainer(), thorlog_null, MCwarning, "Failed to remove: %s", fName.get()); }
catch (IException *e) { ActPrintLogEx(&queryContainer(), e, thorlog_null, MCoperatorWarning, "Failed to remove file: %s", fName.get()); }
catch (CATCHALL) { ActPrintLogEx(&queryContainer(), thorlog_null, MCoperatorWarning, "Failed to remove: %s", fName.get()); }
}

void CDiskWriteSlaveActivityBase::close()
Expand Down Expand Up @@ -495,7 +495,7 @@ void CDiskWriteSlaveActivityBase::close()
}
catch (IException *e)
{
ActPrintLogEx(&queryContainer(), e, thorlog_null, MCwarning, "Error closing file: %s", fName.get());
ActPrintLogEx(&queryContainer(), e, thorlog_null, MCoperatorWarning, "Error closing file: %s", fName.get());
abortSoon = true;
removeFiles();
throw e;
Expand Down Expand Up @@ -618,7 +618,7 @@ void CDiskWriteSlaveActivityBase::process()
try { close(); }
catch (IException *e)
{
EXCLOG(e, "close()");
IWARNLOG(e, "close()"); // NB: primary exception will be rethrown
e->Release();
}
throw;
Expand All @@ -629,7 +629,7 @@ void CDiskWriteSlaveActivityBase::process()
try { close(); }
catch (IException *e)
{
EXCLOG(e, "close()");
IWARNLOG(e, "close()");
e->Release();
}
throw;
Expand Down
Loading
Loading