git-extras
git-extras copied to clipboard
git-effort:fork: retry: Resource temporarily unavailable
I just heard git-extras this powerful tool, and try to use git effort and encounter this error.
❯ ulimit -a
-t: cpu time (seconds) unlimited
-f: file size (blocks) unlimited
-d: data seg size (kbytes) unlimited
-s: stack size (kbytes) 8192
-c: core file size (blocks) 0
-v: address space (kbytes) unlimited
-l: locked-in-memory size (kbytes) unlimited
-u: processes 2784
-n: file descriptors 65535
❯ launchctl limit
cpu unlimited unlimited
filesize unlimited unlimited
data unlimited unlimited
stack 8388608 67104768
core 0 unlimited
rss unlimited unlimited
memlock unlimited unlimited
maxproc 2784 4176
maxfiles 65535 65535
macOS Monterey: 12.3.1, intel git-extra: 6.4.0
since I'm using this command on a private repo, I find another repo to reproduce this.
I'm happy to provide more details if you guys need.
maxproc 2784 4176
I guess it is because the number of processes is not enough, as currently git effort will create a background process per path.
Yeah, so I wonder if we can limit the processes.
nProcs=12 # hardcode, can be replaced to nproc --all
nJobs="\j"
for ((i=0; i<nPaths; ++i))
do
while (( ${nJobs@P} >= nProcs )); do
wait -n
done
effort "${paths[i]}" &
done|tee $tmp
This works for me. The approach comes from https://stackoverflow.com/a/38775799/9482854
PR is welcome!
since the PR is merged, close this issue.