-
Notifications
You must be signed in to change notification settings - Fork 157
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
Change: Replace CPE xml_split with XML iterator #2142
Conversation
When updating the CPEs, the CPE dictionary file is no longer split into separate temporary files. Instead a new XML file iterator added to gvm-libs is used to avoid creating the DOM of the whole file. Also, the buffered insert statements are now also run when a size threshold configurable via a setting is reached. This removes the dependency on the xml_split script, avoids problems with the temp split XML files being left behind in case of crashes and gives more control over the memory usage of the CPEs update.
Conventional Commits Report
🚀 Conventional commits found. |
The error handling is improved by freeing the iterator on errors, consistently jumping to the failure handling and handling cases where (re-)initalizing the parser context fails. Also the limit for the threshold is now always applied.
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.
To me it looks like there are some places where xml_split
could be removed:
- INSTALL.md
- src/CMakeLists.txt
- .docker/prod.Dockerfile (
xml-twig-tools
)
or am i wrong?
This optional dependency is no longer needed with the new XML file iterator.
No, you're right. I've removed these references now. |
Only for references, this could possibly also solves problems from the past like e.g.: |
It seems two additional places have been missed (A comment in the Dockerfile and the community docs) which have been adjusted now accordingly: |
What
When updating the CPEs, the CPE dictionary file is no longer split into separate temporary files. Instead a new XML file iterator added to gvm-libs is used to avoid creating the DOM of the whole file. Also, the buffered insert statements are now also run when a size threshold configurable via a setting is reached.
Why
This removes the dependency on the xml_split script, avoids problems with the temp split XML files being left behind in case of crashes and gives more control over the memory usage of the CPEs update.
References
requires greenbone/gvm-libs#808
GEA-488