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-32615 review Thor jlog logging audiences/levels #19099

Merged

Conversation

jakesmith
Copy link
Member

@jakesmith jakesmith commented Sep 10, 2024

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

Copy link

Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32615

Jirabot Action Result:
Assigning user: [email protected]
Workflow Transition To: Merge Pending
Updated PR

@jakesmith jakesmith requested a review from ghalliday September 10, 2024 13:49
@jakesmith
Copy link
Member Author

@ghalliday - consider this stage 1. I've opened another [stage 2] subtask : https://hpccsystems.atlassian.net/browse/HPCC-32646, to look at migrating worker progress logging to a programmer audience.

Copy link
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good. A few questions about the new categories.

I think it would be a good time to go through all the legacy macro names and change them so they are explicit. Probably something to do one macro at a time

@@ -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);
ERRLOG(e, "CDiskPartHandlerBase::open()");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should really be UERRLOG - ERRLOG is deprecated from the jlog comments.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you made this comment on the 1st commit, it was changed from ERRLOG to IERRLOG in the 3rd commit.
I thought programmer audience vs user is appropriate, since the exception is being fired and propagated back to the user.

@@ -2145,13 +2145,13 @@ bool CJobMaster::fireException(IException *e)
{
case tea_warning:
{
LOG(MCwarning, e);
LOG(MCprogress, e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should kill MCerror, MCwarning and MCprogress, e.g use MCuserProgress - so it is clear what the target audience is.

Copy link
Member Author

@jakesmith jakesmith Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will go through their uses in Thor and transition them

@@ -117,7 +117,7 @@ static bool RegisterSelf(SocketEndpoint &masterEp)
{
StringBuffer slfStr;
StringBuffer masterStr;
LOG(MCdebugProgress, "registering %s - master %s",slfEp.getEndpointHostText(slfStr).str(),masterEp.getEndpointHostText(masterStr).str());
PROGLOG("registering %s - master %s",slfEp.getEndpointHostText(slfStr).str(),masterEp.getEndpointHostText(masterStr).str());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something that should go to the user? Should really be named UPROGLOG to make it clear..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to introduce UPROGLOG (we have same for UERRLOG vs ERRLOG already) and rename all PROGLOG's to UPROGLOG in Thor.

I think it is debatable whether many current user progress logs should be user or programmer (or perhaps a different audience). If an advanced user wants to see the engine making progress, then some lines like these are useful - but for average ECL user, very few are meaningful..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be worth us clearly defining which messages should go to which targets.
It would also make more sense if D was used as the prefixed for debug/programmers rather than I. That would make the functions more consistent. I will take a look at what is there already.

@ghalliday
Copy link
Member

@jakesmith

Copy link
Member Author

@jakesmith jakesmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ghalliday - please see new commits.

@jakesmith jakesmith requested a review from ghalliday September 24, 2024 11:00
Copy link
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have been clearer that some suggestions should have been for later PRs.
This is now in danger of being too large to merge. Can we split this into 2 so the first set of changes can be reviewed and merged twice.

@@ -621,24 +621,24 @@ void CJobManager::run()
{
int p = getRunningMaxPriority(qn);
if (p)
PROGLOG("Dynamic Min priority = %d",p);
UPROGLOG("Dynamic Min priority = %d",p);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these UPROGLOG messages really likely to be useful to the user? I think worth looking at all of them.

@@ -63,7 +63,7 @@ bool recvShutdown = false;
void enableThorSlaveAsDaliClient()
{
#ifdef ISDALICLIENT
PROGLOG("Slave activated as a Dali client");
UPROGLOG("Slave activated as a Dali client");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User not even likely to be able to see this - even if it was relevant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I knew that the existing PROGLOG (now all UPROGLOG's) would need reviewing beyond this, but as part of this PR's move away from deprecated macros to clarify how they are currently being used (the audience) I did a blanket s&r - reviewing/pruning of which UPROGLOG's we actually want to keep as user audience can come later.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have been clearer that some suggestions should have been for later PRs.
This is now in danger of being too large to merge. Can we split this into 2 so the first set of changes can be reviewed and merged twice.

@ghalliday - have rolled back to the original set of changes, and create a new subtask (https://hpccsystems.atlassian.net/browse/HPCC-32727) as a placeholder for the next changes, which I'll attach the other changes to soon.

@jakesmith jakesmith force-pushed the HPCC-32615-exclog-audience branch from 736e1a0 to dcaec1b Compare September 26, 2024 09:21
@jakesmith jakesmith requested a review from ghalliday September 26, 2024 09:22
Copy link
Member

@ghalliday ghalliday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable. Do you want to squash before merging?

@@ -117,7 +117,7 @@ static bool RegisterSelf(SocketEndpoint &masterEp)
{
StringBuffer slfStr;
StringBuffer masterStr;
LOG(MCdebugProgress, "registering %s - master %s",slfEp.getEndpointHostText(slfStr).str(),masterEp.getEndpointHostText(masterStr).str());
PROGLOG("registering %s - master %s",slfEp.getEndpointHostText(slfStr).str(),masterEp.getEndpointHostText(masterStr).str());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be worth us clearly defining which messages should go to which targets.
It would also make more sense if D was used as the prefixed for debug/programmers rather than I. That would make the functions more consistent. I will take a look at what is there already.

@jakesmith
Copy link
Member Author

It would be worth us clearly defining which messages should go to which targets.
It would also make more sense if D was used as the prefixed for debug/programmers rather than I. That would make the functions more consistent. I will take a look at what is there already.

Agreed. The I->D change may make sense to include in the pending 'stage2' PR.
Then another subtask to revisit which of these 'progress' logs should be switched to which audience targets.

@jakesmith jakesmith force-pushed the HPCC-32615-exclog-audience branch from dcaec1b to 5f76167 Compare September 30, 2024 10:45
@jakesmith
Copy link
Member Author

@ghalliday - squashed

@jakesmith
Copy link
Member Author

@ghalliday - this is approved, but I notice now it needs rebasing. Will do now.

Standarize on DBGLOG/[I]WARNLOG/[I]ERRLOG vs LOG(MCdebugProgress & LOG(MCwarning, etc.
Change some PROGLOG's to better audiences (many to DBGLOG)

Signed-off-by: Jake Smith <[email protected]>
@jakesmith jakesmith force-pushed the HPCC-32615-exclog-audience branch from 5f76167 to ebdd3a6 Compare October 3, 2024 12:37
@jakesmith
Copy link
Member Author

@ghalliday - this is approved, but I notice now it needs rebasing. Will do now.

@ghalliday - now rebased to resolve conflict.

@ghalliday ghalliday merged commit 1848747 into hpcc-systems:master Oct 3, 2024
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants