This commit is contained in:
Peter J. Holzer 2022-03-13 23:22:24 +01:00
parent 7180c24cc3
commit e8c34ce1b5
3 changed files with 6 additions and 5 deletions

View File

@ -4,7 +4,7 @@
"unknown"
],
"dynamic_config" : 0,
"generated_by" : "Module::Build version 0.4231",
"generated_by" : "Module::Build version 0.4224",
"license" : [
"perl_5"
],
@ -50,5 +50,5 @@
]
},
"version" : "0.002",
"x_serialization_backend" : "JSON::PP version 4.02"
"x_serialization_backend" : "JSON::PP version 2.97001"
}

View File

@ -4,7 +4,7 @@ author:
- unknown
build_requires: {}
dynamic_config: 0
generated_by: 'Module::Build version 0.4231, CPAN::Meta::Converter version 2.150010'
generated_by: 'Module::Build version 0.4224, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html

View File

@ -294,10 +294,11 @@ sub reserve_fileset {
my ($self, $target) = @_;
my $start = time();
my $pid;
while (time() - $start < 3600) {
my $rows = $self->{dbh}->do(q{update filesets set pid=? where id = ? and pid is null}, {}, $$, $target->{id});
return 1 if $rows == 1;
my $pid = $self->{dbh}->selectrow_array(q{select pid from filesets where id = ?}, {}, $target->{id});
$pid = $self->{dbh}->selectrow_array(q{select pid from filesets where id = ?}, {}, $target->{id});
$self->log(3, "fileset $target->{id} appears to be in use by pid $pid");
if (!kill(0, $pid) && $!{ESRCH}) {
$self->log(3, "pid $pid doesn't exist, trying to release fileset $target->{id}");
@ -305,7 +306,7 @@ sub reserve_fileset {
}
sleep 60;
}
$self->log(2, "fileset $target->{id} appears to be still in use by pid $pid after grace perion - giving up");
$self->log(2, "fileset $target->{id} appears to be still in use by pid $pid after grace period - giving up");
return 0;
}