zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
2.73k stars 122 forks source link

[bug]: `zinit update --parallel` leaves some zombie background process #627

Open vladdoster opened 5 months ago

vladdoster commented 5 months ago

Discussed in https://github.com/zdharma-continuum/zinit/discussions/499

Originally posted by **OmeletWithoutEgg** April 12, 2023 There is a option to update the plugins parallelly. Is it normal that, after running `zinit update --parallel`, it will leave some uncleaned child process? One can run `fg` or just run the parallel update in a shell inside another shell and exit.
OmeletWithoutEgg commented 5 months ago

FYR, I added

if (( main_counter == 0 )) {
    wait
}

locally, after https://github.com/zdharma-continuum/zinit/blob/f26d387e51c9103f2ba7142a8c1a25ba1d62e065/zinit-autoload.zsh#L3459-L3470

so that there is no zombie jobs left. Not sure if this is the correct way to fix it and why is the extra wait needed.