LIBDRUM-991. Modify EtdLoader to check sizes of files in ETD Zip file#265
Open
dsteelma-umd wants to merge 5 commits intodrum-mainfrom
Open
LIBDRUM-991. Modify EtdLoader to check sizes of files in ETD Zip file#265dsteelma-umd wants to merge 5 commits intodrum-mainfrom
dsteelma-umd wants to merge 5 commits intodrum-mainfrom
Conversation
Added tests to verify ETD Loader using a single item, and a single item with an embargo. https://umd-dit.atlassian.net/browse/LIBDRUM-991
In Kubernetes, EtdLoader uncompresses files into an ephemeral volume with limited space. If an uncompressed file exceeds the ephemeral volume size, the pod will reboot. To prevent this, added a “drum.etdloader.maxFileSize” configuration property. A Zip file containing a ZipEntry that is larger than this size will not be processed, and a prominent error message will be added to the log. Updated EtdLoaderTest with a test of the “drum.etdloader.maxFileSize” property and error message. https://umd-dit.atlassian.net/browse/LIBDRUM-991
Modified EtdLoader to exit with a non-zero status code when an error occurs in the processing. Modified the "load-etd" script to capture the status code from the EtdLoader and use it as its exit status. Modified the "load-etd-nightly" script to print an error message and continue to the next file (leaving the file with the error in the "incoming" directory, instead of moving it to the "processed" directory), and return an exit status. Modified "script-main-wrapper" to capture exit status and modify the email "Subject" line to include "- ERROR(S) OCCURRE" on a non-zero exit status. https://umd-dit.atlassian.net/browse/LIBDRUM-991
Removed "testMainMaxFileSizePropertyHandling" because the code under test runs "System.exit", and that interferes with running the tests in Jenkins, where the build fails with the following error: > [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: > The forked VM terminated without properly saying goodbye. > VM crash or System.exit called? Investigated ways to work around this, see especially https://stackoverflow.com/a/309427, but none of the solutions seemed particularly future-proof, or required additional third-party libraries which don't look to have been updated in a while. https://umd-dit.atlassian.net/browse/LIBDRUM-991
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EtdLoader.java
Modified the “EtdLoader” class (dspace/modules/additions/src/main/java/edu/umd/lib/dspace/app/EtdLoader.java) to:
Check the uncompressed size of each “ZipEntry” in the Zip file being processed, and to stop processing and print out an error message if the ZipEntry is larger than the size specified in the “drum.etdloader.maxFileSize” configuration property
Return a status code of “1” when an error occurs (i.e., either the ZipEntry is too large, or an uncaught exception occurs)
load-etd
Modified the “dspace/bin/load-etd” script to return the Java exit code as the return code for the command (0 = success, 1 = error)
load-etd-nightly
Modified the “dspace/bin/load-etd-nightly” script to “continue” (without copying the file from the “processed” directory to “incoming”) if an error occurs. This leaves the unprocessed file in the “incoming” directory for processing at a later date.
Note: The assumption here is that when an error occurs, the item has not been added to DRUM, and therefore should be left in “incoming” for future processing. It is assumed that once the error is noticed it can be reconciled (such as by increasing the ephemeral volume and file size limit if the error was because the ZipEntry file size was too large).
script-mail-wrapper
Modified the script to use a subject line with “- ERROR(S) OCCURRED” suffix if the associated script return with a non-zero return code.
dspace/docs/DrumEtdLoader.md
Additional documentation about the ETD Loaded functionality,
https://umd-dit.atlassian.net/browse/LIBDRUM-991