From db6cbc35506bebf58d9c829a89a231d1fcc16d32 Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Tue, 8 Oct 2024 15:51:42 -0300 Subject: [PATCH 1/2] Account for defining and passing around ulimit. --- scripts/env.sample | 7 +++++++ scripts/util.in | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/scripts/env.sample b/scripts/env.sample index 1292b265..c511cdcf 100644 --- a/scripts/env.sample +++ b/scripts/env.sample @@ -59,6 +59,13 @@ # --- #PROCESSES=1 +# === +# ULIMIT_FOR_PROCESSING: The ulimit to set for the migration processes. +# --- +# NOTE: This may need to be tweaked in multiprocessing scenarios. +#ULIMIT_FOR_PROCESSING=-1 + + # === # SKIP_STATUS: Suppress dumping of migration status before/after operations. # --- diff --git a/scripts/util.in b/scripts/util.in index ccac2ca6..c606abde 100644 --- a/scripts/util.in +++ b/scripts/util.in @@ -65,6 +65,7 @@ function init_vars () { declare -g TIME=${TIME:-/usr/bin/time} declare -g LOG_DIR=${LOG_DIR:-$CONFIG_DIR} declare -g PROCESSES=${PROCESSES:-1} + declare -g ULIMIT_FOR_PROCESSING=${ULIMIT_FOR_PROCESSING:--1} declare -g SKIP_STATUS=${SKIP_STATUS:-false} declare -g -a MULTIPROCESS_SKIP_MIGRATIONS=(${MULTIPROCESS_SKIP_MIGRATIONS[@]}) declare -g -a MULTIPROCESS_PRE_ENQUEUE_PAUSE=(${MULTIPROCESS_PRE_ENQUEUE_PAUSE[@]}) @@ -86,6 +87,9 @@ function init_vars () { export DGI_MIGRATE__DO_MIGRATION_LOOKUP_LOCKING="FALSE" fi + if [ $ULIMIT_FOR_PROCESSING -gt -1 ]; then + ulimit -n $ULIMIT_FOR_PROCESSING + fi set -u } From 8f48c6cbe29e8817df86380c6eece0600b52720b Mon Sep 17 00:00:00 2001 From: Jordan Dukart Date: Tue, 8 Oct 2024 15:51:58 -0300 Subject: [PATCH 2/2] Don't attempt to process the MODS if it can't be found. --- .../dgi_migrate_foxml_standard_mods/migrations/dgis_nodes.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/dgi_migrate_foxml_standard_mods/migrations/dgis_nodes.yml b/modules/dgi_migrate_foxml_standard_mods/migrations/dgis_nodes.yml index 1cbafcef..91f4f2f1 100644 --- a/modules/dgi_migrate_foxml_standard_mods/migrations/dgis_nodes.yml +++ b/modules/dgi_migrate_foxml_standard_mods/migrations/dgis_nodes.yml @@ -259,6 +259,9 @@ process: missing_behavior: skip_process - plugin: dgi_migrate.method method: getUri + - plugin: skip_on_empty + method: row + message: 'Failed to fetch the MODS XML.' # XXX: An issue in the passing off of paths/URIs to libxml prevents the use # of "dgi_migrate.process.xml.domfile" - plugin: callback