-
Notifications
You must be signed in to change notification settings - Fork 305
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-31294 Refactor the way job ids are passed to the logging #18304
HPCC-31294 Refactor the way job ids are passed to the logging #18304
Conversation
https://track.hpccsystems.com/browse/HPCC-31294 |
@jakesmith @richardkchapman what are your thoughts? This was triggered by a discussion with @rpastrana about how to add trace ids into the logging, which made me realise all this code could be cleaned up. |
@ghalliday - there are some build issues, e.g. - https://github.com/hpcc-systems/HPCC-Platform/actions/runs/7928428731/job/21646656101?pr=18304 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ghalliday - looks eminently sensible to me.
A couple of recursive definitions, and some spurious spaces introduced.
system/jlib/jlog.cpp
Outdated
@@ -1289,15 +1285,15 @@ void LogMsgPrepender::report(const LogMsgCategory & cat, const char * format, .. | |||
buff.append(file).append("(").append(line).append(") : ").append(format); | |||
va_list args; | |||
va_start(args, format); | |||
queryLogMsgManager()->report_va(cat, unknownJob, buff.str(), args); | |||
queryLogMsgManager()->report_va(cat, buff.str(), args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trivial/formatting: double space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, an unfortunate side-effect of a global search and replace that didn't include the trailing space. I'll try and fix.
system/jlib/jlog.cpp
Outdated
va_end(args); | ||
} | ||
|
||
void LogMsgPrepender::report_va(const LogMsgCategory & cat, const char * format, va_list args) | ||
{ | ||
StringBuffer buff; | ||
buff.append(file).append("(").append(line).append(") : ").append(format); | ||
queryLogMsgManager()->report_va(cat, unknownJob, buff.str(), args); | ||
queryLogMsgManager()->report_va(cat, buff.str(), args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trivial/formatting: double space
system/jlib/jlog.cpp
Outdated
txt.append(prefix).append(" : "); | ||
exception->errorMessage(txt); | ||
queryLogMsgManager()->report(cat, job, exception->errorCode(), "%s(%d) : %s", file, line, txt.str()); | ||
queryLogMsgManager()->report(cat, exception->errorCode(), "%s", buff.str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trivial/formatting: double space
..and a number of others in changes below.
system/jlib/jlog.cpp
Outdated
va_end(args); | ||
} | ||
void ctxlogReportVA(const LogMsgCategory & cat, LogMsgCode code, const char * format, va_list args) | ||
{ | ||
ctxlogReportVA(cat, unknownJob, code, format, args); | ||
ctxlogReportVA(cat, code, format, args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the recursive call.
Should it be:
queryLogMsgManager()->report_va(cat, code, format, args);
system/jlib/jlog.cpp
Outdated
StringBuffer buff; | ||
e->errorMessage(buff); | ||
ctxlogReport(cat, job, e->errorCode(), "%s%s%s", prefix ? prefix : "", prefix ? prefix : " : ", buff.str()); | ||
ctxlogReport(cat, e, prefix); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also recursive I think. Should it be:
queryLogMsgManager()->report(cat, e, prefix);
``` @
c7df05e
to
98411d4
Compare
https://track.hpccsystems.com/browse/HPCC-31294 |
@jakesmith I have now rebased this, squashed the previous commits, and added a couple more commits to clean the code up further |
thorJob.setJobID(thorJobId); | ||
setDefaultJobId(thorJobId); | ||
activeJobName.clear(); | ||
activeJobName.set(wuid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trivial: it's fine as it is, looking at these 2 lines, it made me think 'set' should implicitly clear if it needs to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ghalliday - I can't spot any issues (1 trivial comment).
I did not spot any issues |
3cda6cf
to
50d4fdd
Compare
Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
50d4fdd
to
632212b
Compare
1b9763f
into
hpcc-systems:candidate-9.6.x
Type of change:
Checklist:
Smoketest:
Testing: