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-30184 Expose WU "Process" meta info in WsWorkunits.WUInfo #17997

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

wangkx
Copy link
Member

@wangkx wangkx commented Nov 6, 2023

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

github-actions bot commented Nov 6, 2023

@wangkx wangkx requested a review from jakesmith November 6, 2023 20:01
@wangkx
Copy link
Member Author

wangkx commented Nov 6, 2023

@jakesmith I tested this PR and it does report all the items of the WU "Process" section in my local containerized environment and bare metal environment.

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.

@wangkx - looks good, a couple of minor comments.

@@ -1294,6 +1294,7 @@ interface IConstWorkUnit : extends IConstWorkUnitInfo
virtual IStringIterator *getLogs(const char *type, const char *instance=NULL) const = 0;
virtual IStringIterator *getProcesses(const char *type) const = 0;
virtual IPropertyTreeIterator* getProcesses(const char *type, const char *instance) const = 0;
virtual IPropertyTreeIterator* getAllProcesses() const = 0;
Copy link
Member

Choose a reason for hiding this comment

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

instead of extending the interface, can you allow the existing getProcesses calls to return all, if type and/or instance are null?

esp/services/ws_workunits/ws_workunitsHelpers.cpp Outdated Show resolved Hide resolved
esp/services/ws_workunits/ws_workunitsHelpers.cpp Outdated Show resolved Hide resolved
@wangkx wangkx requested a review from jakesmith November 9, 2023 18:11
@wangkx
Copy link
Member Author

wangkx commented Nov 9, 2023

@jakesmith please review my changes.

xpath.append(instance);
else
StringBuffer xpath("Process/");
if (isEmptyString(type) && isEmptyString(instance))
Copy link
Member

Choose a reason for hiding this comment

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

apologies, I don't think this is right (my fault of suggesting it), it now conflates the purpose of the method (it can now return 'processes' or 'types'.

It was better as you had it before with a new method, but the name should have been clearer to indicate it is returning an iterator of types not processes, e.g. call it 'getProcessTypes'

Copy link
Member Author

Choose a reason for hiding this comment

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

No problem. I will change back to the new method with the new name.

if (!isEmptyString(pattern))
p->setPattern(pattern);

processList.append(*p.getLink());
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 p.getClear()

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.

@wangkx - please see comments.

@wangkx wangkx requested a review from jakesmith November 15, 2023 19:47
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.

@wangkx - looks good.

@jakesmith
Copy link
Member

@wangkx - please squash

Revise based on review:
1. rename the getAllProcesses() to getProcessTypes().
2. revise the code for querying process data from IPropertyTree.
3. set default values from ecm file.

Signed-off-by: wangkx <[email protected]>
@wangkx
Copy link
Member Author

wangkx commented Nov 16, 2023

@ghalliday please merge this PR.

@ghalliday ghalliday merged commit 90a2a67 into hpcc-systems:candidate-9.4.x Nov 17, 2023
43 of 45 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.

3 participants