Skip to content

Conversation

@dsteelma-umd
Copy link

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

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
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.

1 participant