Re: MLDBM Tie Errors

2002-05-14 Thread Joshua Chamas

Franck PORCHER wrote:
 
 Well, I'm not 100% sure, but I recently switched for MLDBM and got this
 problem too. Here is what I found, and did to remedy the situation :
 
 It *seemed* to me that the physical MLDBM repository was not physically created
 until I actually wrote something into it, eventhough it was reported as
 correctly open RW.
 

This is correct.  This is a performance enhancement, with the side effect
that write errors will occur at runtime.

 So, any ends of my application trying to fetch value during this
 transcient stage got this kind of error (I do not remember
 precisely which one I got, but very close indeed).
 
 I solved the problem by doing an awful trick on each RW opening, such as
 :
 
 eval {
tie %hash, MLDBM::Sync, $storage, O_RDWR | O_CREAT, 0660;
$hash{'__DuMmY__'} = 'OK';
delete $hash{'__DuMmY__'};
  };
 
 That solved the problem in the midtime, waiting for something
 much better...
 

You could also 

  tie %hash, MLDBM::Sync, $storage, O_RDWR | O_CREAT, 0660;
  tied(%hash)-Lock;

to similar effect, as Lock() will actually force a tie to 
the dbm on disk.

The basic premise of MLDBM::Sync is that the tie/untie actually
occur at the reads  writes, so that i/o is flushed correctly.

--Josh
_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks Founder   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



Re: MLDBM Tie Errors

2002-05-14 Thread Mike Martinet

Are you suggesting that I modify Sync.pm?


MjM

[EMAIL PROTECTED] wrote:

  Franck PORCHER wrote:
 
 Well, I'm not 100% sure, but I recently switched for MLDBM and got this
 problem too. Here is what I found, and did to remedy the situation :
 
 It *seemed* to me that the physical MLDBM repository was not 
physically created
 until I actually wrote something into it, eventhough it was reported as
 correctly open RW.
 
 
 
  This is correct.  This is a performance enhancement, with the side effect
  that write errors will occur at runtime.
 
 
 So, any ends of my application trying to fetch value during this
 transcient stage got this kind of error (I do not remember
 precisely which one I got, but very close indeed).
 
 I solved the problem by doing an awful trick on each RW opening, such as
 :
 
 eval {
tie %hash, MLDBM::Sync, $storage, O_RDWR | O_CREAT, 0660;
$hash{'__DuMmY__'} = 'OK';
delete $hash{'__DuMmY__'};
  };
 
 That solved the problem in the midtime, waiting for something
 much better...
 
 
 
  You could also
 
tie %hash, MLDBM::Sync, $storage, O_RDWR | O_CREAT, 0660;
tied(%hash)-Lock;
 
  to similar effect, as Lock() will actually force a tie to
  the dbm on disk.
 
  The basic premise of MLDBM::Sync is that the tie/untie actually
  occur at the reads  writes, so that i/o is flushed correctly.
 
  --Josh
  _
  Joshua Chamas   Chamas Enterprises Inc.
  NodeWorks Founder   Huntington Beach, CA  USA
  http://www.nodeworks.com1-714-625-4051
 





MLDBM Tie Errors

2002-05-13 Thread Mike Martinet

Greetings,

With this setup:

Linux kernel 2.4.7-10
Apache 1.3.24
mod_perl-1.26
Apache::ASP 2.33
MLDBM 0.25

I keep getting the following errors:

First this -

[Mon May 13 08:57:26 2002] [notice] Apache/1.3.24 (Unix) mod_perl/1.26 
mod_ssl/2.8.8 OpenSSL/0.9.6b configured -- resuming normal operations

[Mon May 13 08:57:26 2002] [notice] Accept mutex: sysvsem (Default: sysvsem)
can't unlink dir /mnt/hdb/www/content//: Directory not empty at 
/usr/lib/perl5/site_perl/5.6.1/MLDBM/Sync.pm line 110.

then shortly thereater (it seems) this -

MLDBM error: Second level tie failed, Invalid argument at 
/usr/lib/perl5/site_perl/5.6.1/MLDBM/Sync.pm line 209
[Mon May 13 09:25:48 2002] [error] can't tie to MLDBM with args: 
,66,416; error:  at /usr/lib/perl5/site_perl/5.6.1/MLDBM/Sync.pm line 209.


This appears to be random.  I'm trying to figure out which code I've 
written might be triggering it, but I'm having trouble tracking it down. 
  Sometimes a server restart is required to recover; sometimes not.  The 
two errors don't always appear together.

Any help would be greatly appreciated.


Thanks,



MjM




Re: MLDBM Tie Errors

2002-05-13 Thread Joshua Chamas

Mike Martinet wrote:
 
 Greetings,
 
 With this setup:
 
 Linux kernel 2.4.7-10
 Apache 1.3.24
 mod_perl-1.26
 Apache::ASP 2.33
 MLDBM 0.25
 

Please submit a trace of the error_log for the request, with 

  PerlSetVar Debug -1

set, and a description of the problem as well as what file 
permissions for /mnt/hdb/www/content/ look like ( ls -l )
to the Apache::ASP list at [EMAIL PROTECTED]

Please submit the error_log for a full request that contains
the error.  It might also help to set $SIG{__DIE__} = \Carp::confess;
somewhere to recover a stack trace of where the error occurs.

--Josh