Subject: | Locking issue when starting two CPAN shells simultaneously |
If two CPAN shells are started at (nearly) the same time, then one shell
gets stuck in this loop:
Could not lock lockfile with flock: Bad file descriptor; retrying
Could not lock lockfile with flock: Resource temporarily unavailable;
retrying
...
(Linux version)
or
Could not lock lockfile with flock: ; retrying
Could not lock lockfile with flock: Resource temporarily unavailable;
retrying
...
(FreeBSD version)
The problem seems to be caused by the line 967 in checklock():
if (-f $lockfile && -M _ > 0) {
This means if the other process created the lockfile after start of
this process, then the normal lock check code will be bypassed.
I think the -M condition can be removed safely.
Regards,
Slaven