Skip to content

Commit e0afa77

Browse files
author
root
committed
Bump fasterdata-tuning to 1.3.8
1 parent a79a927 commit e0afa77

File tree

4 files changed

+33
-15
lines changed

4 files changed

+33
-15
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
All notable changes to this repository will be documented in this file.
77

8+
## [1.3.8] - 2026-01-26
9+
10+
### Fixed
11+
12+
- `fasterdata-tuning.sh` v1.3.8: Guard all flags that require a value so missing arguments fail fast with a helpful error instead of triggering `set -u` unbound variable crashes (e.g., `--restore-state`).
13+
814
## [1.3.7] - 2025-12-19
915

1016
### Fixed

docs/perfsonar/tools_scripts/fasterdata-tuning.sh

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
# fasterdata-tuning.sh
33
# --------------------
4-
# Version: 1.3.7
4+
# Version: 1.3.8
55
# Author: Shawn McKee, University of Michigan
66
# Acknowledgements: Supported by IRIS-HEP and OSG-LHC
77
#
@@ -24,6 +24,7 @@
2424
# --diff-state/--restore-state can parse saved files reliably.
2525
# NEW in v1.3.6: Respect --dry-run for packet pacing; audit checks actual qdisc.
2626
# NEW in v1.3.7: Fix summary display of packet pacing status to correctly detect applied qdisc.
27+
# NEW in v1.3.8: Validate required option arguments up front to avoid unbound-variable errors and provide clearer CLI feedback.
2728
#
2829
# Sources: https://fasterdata.es.net/host-tuning/ , /network-tuning/ , /DTN/
2930
#
@@ -129,6 +130,17 @@ State Management Options:
129130
EOF
130131
}
131132

133+
# Ensure required option arguments are present; fail fast with a helpful message
134+
require_arg() {
135+
local flag="$1"
136+
local val="${2-}"
137+
if [[ -z "$val" || "$val" == -* ]]; then
138+
echo "ERROR: $flag requires an argument" >&2
139+
usage
140+
exit 1
141+
fi
142+
}
143+
132144
# Speed-specific tuning recommendations from ESnet fasterdata.es.net
133145
# Values indexed by link speed in Mbps: [rmem_max, wmem_max, tcp_rmem_max, tcp_wmem_max, netdev_max_backlog]
134146
# For measurement hosts (perfSONAR): optimized for moderate RTT (50-100ms) paths
@@ -3184,30 +3196,30 @@ print_summary() {
31843196
main() {
31853197
while [[ $# -gt 0 ]]; do
31863198
case "$1" in
3187-
--mode) MODE="$2"; shift 2;;
3188-
--ifaces) IFACES="$2"; shift 2;;
3189-
--target) TARGET_TYPE="$2"; shift 2;;
3190-
--tbf-cap-rate) TBF_CAP_RATE="$2"; USE_TBF_CAP=1; shift 2;;
3191-
--packet-pacing-rate) TBF_CAP_RATE="$2"; USE_TBF_CAP=1; log_warn "--packet-pacing-rate is deprecated; use --tbf-cap-rate"; shift 2;;
3199+
--mode) require_arg "$1" "${2-}"; MODE="$2"; shift 2;;
3200+
--ifaces) require_arg "$1" "${2-}"; IFACES="$2"; shift 2;;
3201+
--target) require_arg "$1" "${2-}"; TARGET_TYPE="$2"; shift 2;;
3202+
--tbf-cap-rate) require_arg "$1" "${2-}"; TBF_CAP_RATE="$2"; USE_TBF_CAP=1; shift 2;;
3203+
--packet-pacing-rate) require_arg "$1" "${2-}"; TBF_CAP_RATE="$2"; USE_TBF_CAP=1; log_warn "--packet-pacing-rate is deprecated; use --tbf-cap-rate"; shift 2;;
31923204
--apply-packet-pacing) APPLY_PACKET_PACING=1; shift;;
31933205
--use-tbf-cap) USE_TBF_CAP=1; shift;;
31943206
--color) USE_COLOR=1; shift;;
31953207
--nocolor) USE_COLOR=0; shift;;
31963208
--apply-iommu) APPLY_IOMMU=1; shift;;
3197-
--iommu-args) IOMMU_ARGS="$2"; shift 2;;
3198-
--apply-smt) APPLY_SMT="$2"; shift 2;;
3209+
--iommu-args) require_arg "$1" "${2-}"; IOMMU_ARGS="$2"; shift 2;;
3210+
--apply-smt) require_arg "$1" "${2-}"; APPLY_SMT="$2"; shift 2;;
31993211
--persist-smt) PERSIST_SMT=1; shift;;
3200-
--apply-tcp-cc) APPLY_TCP_CC="$2"; shift 2;;
3212+
--apply-tcp-cc) require_arg "$1" "${2-}"; APPLY_TCP_CC="$2"; shift 2;;
32013213
--apply-jumbo) APPLY_JUMBO=1; shift;;
32023214
--yes) AUTO_YES=1; shift;;
32033215
--dry-run) DRY_RUN=1; shift;;
32043216
--json) OUTPUT_JSON=1; shift;;
32053217
--save-state) SAVE_STATE=1; shift;;
3206-
--label) STATE_LABEL="$2"; shift 2;;
3207-
--restore-state) RESTORE_STATE="$2"; shift 2;;
3218+
--label) require_arg "$1" "${2-}"; STATE_LABEL="$2"; shift 2;;
3219+
--restore-state) require_arg "$1" "${2-}"; RESTORE_STATE="$2"; shift 2;;
32083220
--list-states) LIST_STATES=1; shift;;
3209-
--diff-state) DIFF_STATE="$2"; shift 2;;
3210-
--delete-state) DELETE_STATE="$2"; shift 2;;
3221+
--diff-state) require_arg "$1" "${2-}"; DIFF_STATE="$2"; shift 2;;
3222+
--delete-state) require_arg "$1" "${2-}"; DELETE_STATE="$2"; shift 2;;
32113223
--auto-save-before) AUTO_SAVE_BEFORE=1; shift;;
32123224
-h|--help) usage; exit 0;;
32133225
-v|--version) echo "fasterdata-tuning.sh v$(get_script_version)"; exit 0;;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5ac597d118a4d341b1b8107df884d2ed6a3f52e851123606e05ef1f841dec85c fasterdata-tuning.sh
1+
d01e94fd59b7198f6d755c5dc94e480b00ebd59f7069e20cc12ee5b1a91d24f0 fasterdata-tuning.sh

docs/perfsonar/tools_scripts/scripts.sha256

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
2812b78534e8268751250b271cf0ac1868a6a8b420f9e6b4f96f715459d0eaf5 check-deps.sh
33
f0bf15b7223447878b00260d33f1db41995f47d4b56216911bbabe7f1b8435a9 check-perfsonar-dns.sh
44
d1f100e2e5eba58007bf89455edb1b7065e8e7124c9a4238f18ce13c60a2f2e5 configure-toolkit-letsencrypt.sh
5-
f8cee9f11e57d06a0239186d9371e4f520b1cc6bb20527e6d58cc31d6af1316b fasterdata-tuning.sh
5+
d01e94fd59b7198f6d755c5dc94e480b00ebd59f7069e20cc12ee5b1a91d24f0 fasterdata-tuning.sh
66
14d88a50bcbc606b21b00b4bcfab779c2a2f70f1576593f66502611719620df0 install-systemd-service.sh
77
4b2b91593a3ceb3c8159cc2d6ca749aeeb7a558a766227c46493feb84655f04a install-systemd-units.sh
88
9d9ff6bab281c800c923ac9616c9f88502e9677d6902d3df243fa5faf50a02fe install_tools_scripts.sh

0 commit comments

Comments
 (0)