install/all.sh captures background PIDs via $(parallel_run_best_effort …), so wait fails and jobs run serially
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia dal commento di intestazione in src/scripts/lib/parallel.sh, poi esamina parallel_run_best_effort e parallel_wait_pids_best_effort. In src/scripts/install/all.sh, gli array REPO_PIDS, ASYNC_PIDS e RPM_PIDS (intorno alle righe 80, 128 e 136) catturano l'output tramite $(...); modifica ciascuno per richiamare direttamente l'helper e aggiungere "$!". Il lavoro è completato quando le chiamate wait smettono di registrare falsi errori e i passaggi di installazione si sovrappongono in un'esecuzione completa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
src/scripts/install/all.sh starts background jobs through command substitution, for example PIDS+=("$(parallel_run_best_effort "$DIR/$script")"). The comment at the top of src/scripts/lib/parallel.sh warns against this pattern:
Capture PIDs in the caller shell (parallel_run_*; PIDS+=($!)), not via $(...), or wait(1) will fail because the background job was started in a subshell.
Severity: medium. This doesn't affect security, but installs run slower than intended and print misleading warnings.
Affected code
src/scripts/install/all.sh: line 80 (REPO_PIDS), line 128 (ASYNC_PIDS), line 136 (RPM_PIDS)
Found while working on #20 (bats unit tests).
What goes wrong
parallel_run_best_effort runs bash "$script" || true & and then echo $!. Because it's called inside $( … ):
- The parent shell doesn't own the PID. The job is a child of the command-substitution subshell, so
wait <pid>inparallel_wait_pids_best_effortfails, and each wait logs a "WARNING … failed" line even when the script succeeded. Real failures can't be told apart from these false ones. - The jobs run one at a time. The background job inherits the substitution's stdout pipe, so
$( … )blocks until the job finishes and closes that pipe. Each "parallel" step waits for the previous one to finish.
Remediation
Call the helper directly and capture $! in the caller shell, the way ubuntu-setup-scripts and arch-setup-scripts already do:
parallel_run_best_effort "$DIR/$script"
REPO_PIDS+=("$!")
Apply this to every array listed above. Optionally, drop the echo $! from parallel_run_best_effort (or send it to /dev/null) so callers don't depend on stdout. Then run a full install and check that the steps overlap and the "failed" warnings are gone.
- Lingua principale
- Shell
- Stelle
- 1
- Fork
- 0
- Merge medio
- 1h 7m
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di garretpatten/fedora-setup-scripts
-
Add bats-core unit testsApertatests
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Tutte le issue di garretpatten/fedora-setup-scripts
Issue simili
-
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
posthog
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
DobermanCore/Doberman-Core#827 ·
I maintainer di solito rispondono entro 1 giorno
-
category:enhancement status:needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
nushell/nushell#19546 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
release.yml fetches the GitHub CLI keyring with a bare curl, the one workflow download with no retryApertabug ci phase:10 priority:p3
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
jimmy058910/jmo-security-repo#1629 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
achisolomon/software-factory#182 ·