-
Notifications
You must be signed in to change notification settings - Fork 311
HPCC-35524 Add logaccess plugin load analytics #20753
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
base: candidate-9.12.x
Are you sure you want to change the base?
HPCC-35524 Add logaccess plugin load analytics #20753
Conversation
|
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-35524 Jirabot Action Result: |
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.
Pull request overview
This PR adds enhanced diagnostics for logaccess plugin loading failures in the getHealthReport endpoint. When a logaccess plugin fails to load, the system now performs detailed diagnostics to determine whether the issue is due to missing configuration, incorrect plugin type specification, library loading failures, or factory procedure lookup problems.
Key changes:
- Added a diagnostic function to analyze plugin loading issues independently of the normal plugin loading flow
- Enhanced health report to provide specific, actionable error messages based on diagnostic results
- Introduced structured diagnostic information that can be included in configuration reports
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| system/jlib/jlog.hpp | Added LogAccessPluginDiagnostics struct to hold diagnostic information and declared diagnoseLogAccessPluginLoad function |
| system/jlib/jlog.cpp | Implemented diagnoseLogAccessPluginLoad function that safely attempts to load and verify the plugin library without raising exceptions |
| esp/services/ws_logaccess/WsLogAccessService.cpp | Modified onGetHealthReport to call diagnostic function when no plugin is loaded, providing detailed error messages based on diagnostic results |
a70b226 to
a759a4b
Compare
|
failed ESP regression suite check can be ignored, https://hpccsystems.atlassian.net/browse/HPCC-35534 |
- Adds plugin/configuration issue analysis Co-authored-by: rpastrana <915949+rpastrana@users.noreply.github.com>
a759a4b to
a82fb21
Compare
system/jlib/jlog.cpp
Outdated
| diagnostics.pluginType.set(type.str()); | ||
|
|
||
| StringBuffer libName; | ||
| libName.append("lib").append(type.str()).append("logaccess"); |
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.
Since we're in code that could be run from a Windows build, is the "lib" prefix a valid assumption? LoadSharedObject looks for it, adding it when appropriate.
- Replace boolean flags (configFound, loadAttempted, loadSucceeded) with single LogAccessDiagnosticState enum - Add enum values: ConfigNotFound, ConfigFoundNoType, LoadFailed, LoadSucceeded - Rename diagnostics.state to logAccessPluginLoadState for clarity - Update WsLogAccessService.cpp to use clean switch-based logic instead of nested if-else - Change diagnostics.pluginType from StringAttr to StringBuffer for direct getProp() usage - Eliminate unnecessary temporary variables in diagnoseLogAccessPluginLoad() - Ensure consistent methodName usage across all diagnostic messages - Update Python test suite to match new enum-based field names - Maintain backward compatibility while improving code maintainability Co-authored-by: rodrigo pastrana <rodrigo.pastrana@lexisnexis.com>
| } | ||
|
|
||
| StringBuffer libName; | ||
| libName.append("lib").append(diagnostics.pluginType.str()).append("logaccess"); |
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.
Still not sure about the inclusion of the non-Win32 value of SharedObjectPrefix is appropriate here. Linux and MacOS builds will add this automatically in LoadSharedObject (because no extension is given). It should not be added in Win32 builds. Can this code be called in Windows builds?
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.
Thanks, Tim. It looks like you spotted an inconsistency (maybe an issue) with the logaccess plugin loading logic (https://github.com/hpcc-systems/HPCC-Platform/blob/4264c9e1f49f549e63ff9d3526036b588b5f6e6b/system/jlib/jlog.cpp#L3473C48-L3473C64). To be clear, this code isn't actually attempting to load the plugin, but rather mimic the plugin loading process to ascertain potential issues. The issue spotted should be addressed separately: https://hpccsystems.atlassian.net/browse/HPCC-35558
timothyklemm
left a comment
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.
Looks ok. One nitpick would be the unnecessary return statements on lines 3554 and 3562.
Co-authored-by: Rodrigo Pastranarodrigo.pastrana@lexisnexis.com
Type of change:
Checklist:
Smoketest:
Testing: