gluster / gluster-prometheus

Gluster monitoring using Prometheus
GNU Lesser General Public License v2.1
119 stars 70 forks source link

fix infinite fork loop when dep fails in 'make vendor-install' #197

Open nuno-silva opened 2 years ago

nuno-silva commented 2 years ago

In #164, a || $(MAKE) vendor-install was added to the vendor-install target to help with "poor network circumstances": https://github.com/gluster/gluster-prometheus/blob/3ebaacc2c690223f77fc93f5f237ab5065138660/Makefile#L82-L85

However, this leads to an infinite fork loop when dep fails or is not installed, possibly crashing the host machine.

This PR works around the infinite loop by checking the MAKELEVEL and aborting if it gets too high, which still allows the command to be retried a reasonable number of times. Another possible approach is just looping around dep a set number of times.

Fixes #195.