Skip to content

Commit 52e4c56

Browse files
authored
fix(verify-release): fix bash pipe FD leak causing deadlock on maven checksum verification (#4024)
* fix(verify-release): fix bash pipe FD leak causing deadlock on maven checksum verification * Review from @dimas-b
1 parent 3e80dd5 commit 52e4c56

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

tools/verify-release/verify-release.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,14 +219,21 @@ function log_info {
219219
# Following arguments: process arguments
220220
function proc_exec {
221221
local err_msg
222-
local output
222+
local output_file
223+
local exit_code
223224
err_msg=$1
224225
shift
225-
output=()
226-
IFS=$'\n' read -r -d '' -a output < <( "${@}" 2>&1 && printf '\0' ) || (
227-
log_fatal "${err_msg}" "${output[@]}"
226+
output_file=$(mktemp)
227+
"${@}" > "${output_file}" 2>&1
228+
exit_code=$?
229+
if [[ $exit_code -ne 0 ]]; then
230+
local output
231+
output=$(cat "${output_file}")
232+
rm -f "${output_file}"
233+
log_fatal "${err_msg}" "${output}"
228234
return 1
229-
)
235+
fi
236+
rm -f "${output_file}"
230237
}
231238

232239
function mirror {

0 commit comments

Comments
 (0)