There is an ongoing outage on the primary CPAN mirror. It is possible to work around the issue by using MetaCPAN as a mirror.

check_lock

Check to see if the lock exists

Have a max retry count to avoid infinite loops