[Interchange-bugs] [Bug 267] Changed - Interchange errors out on file locking

bugzilla-daemon@interchange.redhat.com bugzilla-daemon@interchange.redhat.com
Tue Jul 10 08:27:02 2001


http://developer.akopia.com/bugs/show_bug.cgi?id=267

*** shadow/267	Tue Jul 10 00:24:48 2001
--- shadow/267.tmp.8345	Tue Jul 10 08:26:03 2001
***************
*** 1,11 ****
  Bug#: 267
  Product: Interchange
! Version: 4.6.5
  Platform: HP
  OS/Version: HP-UX
! Status: NEW   
  Resolution: 
! Severity: major
  Priority: P2
  Component: Core
  AssignedTo: mike@minivend.com                            
--- 1,11 ----
  Bug#: 267
  Product: Interchange
! Version: 4.7.x
  Platform: HP
  OS/Version: HP-UX
! Status: ASSIGNED   
  Resolution: 
! Severity: enhancement
  Priority: P2
  Component: Core
  AssignedTo: mike@minivend.com                            
***************
*** 74,76 ****
--- 74,116 ----
  experiencing similar problems.
  
  Lemme know what I can do to help.
+ 
+ ------- Additional Comments From mike@minivend.com  2001-07-10 08:26 -------
+ While this appears to be a problem on the HP platform, on virtually every
+ other UNIX it works fine.
+ 
+ The file is *inteneded* to be locked with a F_WRLCK, so that we know when
+ there is an active Interchange process. If the file exists but is not locked,
+ we know that the previous daemon terminated with an error. If it is non-existent,
+ the previous daemon terminated normally. If it exists but is locked, we know
+ that there is an active daemon.
+ 
+ My guess is that this is really a defisiency in the flock emulation on Perl for
+ HP-UX.
+ 
+ We won't do anything for 4.6.5 on this, but we can probably do in 4.7.x
+ in Vend/Util.pm
+ 
+ 1207,1212c1207
+ < if($Global::Windows) {
+ <       set_lock_type('none');
+ < }
+ < elsif($^O =~ /hpux/) {
+ <       set_lock_type('fcntl');
+ < }
+ ---
+ > set_lock_type('none') if $Global::Windows;
+ 
+ You might try a similar thing in the Util.pm for 4.6.x
+ below the last reference of $lock_function:
+ 
+ if($^O =~ /hpux/) {
+    $lock_function = \&fcntl_lock;
+    $unlock_function = \&fcntl_unlock;
+ }
+ 
+ No guarantees that will work -- we never have an HP-UX platform to
+ test on.
+ 
+ 
+ Changed to enhancement for the 4.7.x branch.