Skip Menu |

This queue is for tickets about the Data-RecordStore CPAN distribution.

Report information
The Basics
Id: 125010
Status: resolved
Priority: 0/
Queue: Data-RecordStore

People
Owner: Nobody in particular
Requestors: CHORNY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 3.17
Fixed in: 3.20



Subject: [patch] tests hang on Windows
This code hangs on Windows flock($fh, LOCK_SH); flock($fh, LOCK_EX); Patch adds timeout to prevent hanging. It does not solve problems of locks. -- Alexandr Ciornii, http://chorny.net
Subject: RecordStore.pm.patch
--- RecordStore.pm.dist 2018-04-02 22:38:10.000000000 +0300 +++ RecordStore.pm 2018-04-04 14:08:28.000000000 +0300 @@ -974,8 +974,18 @@ } sub _lock_write { my $fh = shift->[LOCK]; + if ($^O eq 'MSWin32') { + my $try = 0; + while (1) { + return if flock( $fh, 2 + 4); + $try++; + die "cannot lock" if $try > 30; + sleep(1); + } + } else { flock( $fh, 2 ); } +} sub _unlock { my $fh = shift->[LOCK]; flock( $fh, 8 );
Thanks for the patch. I've decided to remove the flocking all together and let implementers handle any lock coordination.