Skip to Content.
Sympa Menu

devel - Re: [sympa-dev] Is a lock need for /stats ?

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Kazuo Moriwaka <address@concealed>
  • To: address@concealed
  • Cc: address@concealed
  • Subject: Re: [sympa-dev] Is a lock need for /stats ?
  • Date: Mon, 11 Jul 2005 17:45:20 +0900 (JST)

Hello,

I fixed the NFS-aware locking patch. It was used filename to key of
lock-objects hash.

Attached patch changes the hash's key to reference of filehandle for
locked file. This is need for that one daemon can open same file twice
or more at a same time.

regards,

From: Olivier Salaün - CRU <address@concealed>
Subject: Re: [sympa-dev] Is a lock need for /stats ?
Date: Mon, 04 Jul 2005 17:29:08 +0200

> Thank you for submiting this patch ;
> I suggest you also upload it in our bug/feature tracking system :
> http://listes.cru.fr/mantis/
>
> It will probably not be part of Sympa 5.1 release but rather 5.2
>
> Kazuo Moriwaka wrote:
>
> >I post NFS-aware locking patch. Please check attachment.
> >
> >I changed locking module to File::NFSLock. It has shared lock.
> >
> >I'm sorry for I cannot find "include" directive what you wrote.
> >I implement module existence check temporarily with 'eval'. If there are
> >some problems, please correct it.
--
Kazuo Moriwaka <address@concealed>


--- src/tools.pl (revision 129)
+++ src/tools.pl (working copy)
@@ -2034,7 +2034,7 @@
stale_lock_timeout => $hold,
}) {
&do_log('debug2', 'Got lock for %s on %s', $mode, $lock_file);
- $locks{$lock_file} = $lock;
+ $locks{\*FH} = $lock;
}else {
&do_log('err', 'Failed locking %s: %s', $lock_file, $!);
close(FH);
@@ -2049,8 +2049,8 @@
my $lock_file = shift;
my $fh = shift;

- my $lock = $locks{$lock_file};
- delete $locks{$lock_file};
+ my $lock = $locks{$fh};
+ delete $locks{$fh};

unless ($lock->unlock) {
&do_log('err', 'Failed UNlocking %s: %s', $lock_file, $!);




Archive powered by MHonArc 2.6.19+.

Top of Page