Skip to content

Commit

Permalink
Merge pull request #147 from discoverygarden/fix/ulimit-passing
Browse files Browse the repository at this point in the history
Account for defining and passing around ulimit.
  • Loading branch information
jordandukart authored Oct 8, 2024
2 parents a75b679 + 8f48c6c commit 3ec6eed
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions scripts/env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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.
# ---
Expand Down
4 changes: 4 additions & 0 deletions scripts/util.in
Original file line number Diff line number Diff line change
Expand Up @@ -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[@]})
Expand All @@ -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
}

Expand Down

0 comments on commit 3ec6eed

Please sign in to comment.