fix: Race condition in validate-examples parallel execution
The wait -n + pid array removal was buggy - it removed the first pid from the array when any job finished, not the one that actually completed. This caused the final wait loop to miss some processes. Fix: Use bare 'wait' at the end which waits for ALL background processes, regardless of what's in the pid array.
This commit is contained in:
parent
ed6c9666b2
commit
bf7f890f46
1 changed files with 5 additions and 5 deletions
|
|
@ -333,12 +333,12 @@ validate_examples_parallel() {
|
|||
fi
|
||||
done
|
||||
|
||||
# Wait for ALL remaining jobs to complete
|
||||
for pid in "${pids[@]}"; do
|
||||
wait "$pid" 2>/dev/null || true
|
||||
done
|
||||
# Wait for ALL background jobs to complete (not just tracked pids)
|
||||
# Using bare 'wait' ensures we catch all subprocesses, even those
|
||||
# whose pids were incorrectly removed from the array by wait -n
|
||||
wait
|
||||
|
||||
# Wait a bit more to ensure all file writes are complete
|
||||
# Extra safety margin for filesystem sync
|
||||
sleep 0.5
|
||||
|
||||
# Aggregate results from result files (since subshell variables don't propagate)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue