Skip to content

HPCC-33568 Introduce a lingering c++ compile #19869

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

Merged
merged 1 commit into from
May 29, 2025

Conversation

ghalliday
Copy link
Member

@ghalliday ghalliday commented May 14, 2025

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:

@ghalliday
Copy link
Member Author

@jakesmith code is written, compiled, but untested. Pushed for initial test.

@ghalliday ghalliday requested review from jakesmith and Copilot May 14, 2025 13:37
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request implements changes to the HPCC C++ compiler infrastructure by refining containerized behavior and introducing a lingering compile server mode. Key changes include:

  • Adjusting job argument construction in jcontainerized.cpp to conditionally include workunit parameters.
  • Refactoring eclccserver.cpp to separate compilation logic into new classes (EclccCompiler, EclccLingeringCompiler) and improving behavior when running containerized compilations.
  • Adding a new macro and helper function in daqueue.hpp to support compile queue naming for the lingering server.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
system/jlib/jcontainerized.cpp Updated job argument generation to conditionally include the workunit parameter.
ecl/eclccserver/eclccserver.cpp Refactored compile thread logic with new compiler classes and adjusted K8s job flow.
dali/base/daqueue.hpp Introduced a new compile queue extension macro and helper function.
Comments suppressed due to low confidence (1)

ecl/eclccserver/eclccserver.cpp:970

  • The call to runJob now passes a nullptr for the workunit identifier instead of the previous wuid. Ensure that this change is intentional and that the runJob function handles a null workunit correctly for lingering compile requests.
k8s::runJob("compile", nullptr, jobName, params);

Comment on lines 816 to 818
//If the process is killed it is probably because it ran out of memory - so try to compile as a K8s job
timedOut = abortWaiter.stop() || (isContainerized() && processKilled);
bool timedOut = abortWaiter.stop() || (isContainerized() && processKilled);
if (!timedOut)
Copy link
Preview

Copilot AI May 14, 2025

Choose a reason for hiding this comment

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

[nitpick] The declaration of 'bool timedOut' within the compile method may be confusing since it replaces the previous out parameter usage. Consider updating related comments or variable names to clarify its intent.

Copilot uses AI. Check for mistakes.


__uint64 executeTimeNs = waitTimer.elapsedNs() - waitTimeNs;
cost_type costExecute = money2cost_type(calcCostNs(costPerHour, executeTimeNs));
const char * username = "MORE";
Copy link
Preview

Copilot AI May 14, 2025

Choose a reason for hiding this comment

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

[nitpick] The use of the hardcoded username 'MORE' for metrics recording might be a placeholder. Consider revisiting this value to use a dynamic or more descriptive identifier if applicable.

Suggested change
const char * username = "MORE";
const char * username = globals->queryProp("@username");
if (!username || !*username)
username = "unknown";

Copilot uses AI. Check for mistakes.

Copy link

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

Jirabot Action Result:
Workflow Transition To: Merge Pending
Updated PR

Copy link
Member

@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 - looks good, didn't spot any problems, 1 minor question.

compileViaK8sJob(true);
return;
}
//NOTE: This call does not modify the workunit itself, so no need to commit afterwards
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what this comment means.. the line below is altering the workunit and the workunit.clear() will commit won't it?

Copy link
Member

Choose a reason for hiding this comment

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

@ghalliday - still not sure re. this comment, is it misplaced? setContainerizedProcessInfo does alter the workunit..

@ghalliday ghalliday changed the base branch from master to candidate-9.12.x May 22, 2025 15:45
@ghalliday ghalliday closed this May 22, 2025
@ghalliday ghalliday reopened this May 22, 2025
@ghalliday ghalliday requested a review from jakesmith May 22, 2025 15:45
@ghalliday
Copy link
Member Author

I may have accidentally merged some of the follow up changes into the second commit.

Copy link

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

Jirabot Action Result:
Workflow Transition To: Merge Pending

Copy link
Member

@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 - looks good, some v. minor comments

workunit->commit();
result = workunit->getState();
}

workunit.clear();
Copy link
Member

Choose a reason for hiding this comment

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

trivial: could be inside the if (workunit) block

workunit->commit();
result = workunit->getState();
Copy link
Member

Choose a reason for hiding this comment

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

trivial: I don't think it matters that after the commit(), but as coded, makes it looks like it is significant?


public:
EclccLingeringCompiler(IPropertyTree * globals, unsigned _idx)
: instanceName(globals->queryProp("@name")), compiler(instanceName, _idx)
Copy link
Member

Choose a reason for hiding this comment

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

I know 'globals' is in scope in the context EclccLingeringCompiler is used.. but it looks unsafe to keep pointer to @name here, for clarify, future safety, is it worth storing in a StringAttr despite not being strictly being necessary at the moment?

compileViaK8sJob(true);
return;
}
//NOTE: This call does not modify the workunit itself, so no need to commit afterwards
Copy link
Member

Choose a reason for hiding this comment

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

@ghalliday - still not sure re. this comment, is it misplaced? setContainerizedProcessInfo does alter the workunit..

@ghalliday ghalliday merged commit f41231a into hpcc-systems:candidate-9.12.x May 29, 2025
22 checks passed
Copy link

Jirabot Action Result:
Added fix version: 9.12.8
Workflow Transition: 'Resolve issue'

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