Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [webmaster33] GT::Session::File problems

Quote Reply
Re: [webmaster33] GT::Session::File problems In reply to
Again a BUG in GT::Session::File module.
There is no file locking used in this module at all!

Code:
sub save {
...
my $fh = \do {local *FH; *FH};
open ($fh, "> $file") or return $self->error ('CANTOPEN', 'FATAL', $file, "$!");
my $dump = GT::Dumper->dump(
var => '$SESSION',
data => $self->{data}
);
print $fh $dump;
close $fh;
...
}

flock() should be used to avoid multiple process access to the same file (read or write) at the same time!

I'm afraid this is true for all Links SQL system as I did read strange data losses on config file, plugin config files, or other file based storages!!!
This is shame Frown

Links SQL does not have support, to be used in race condition environment (except for the database access where the table or row locking is a database dependent feature)!
It should be updated/modified to have file locking used in ALL file reads & writes!

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Subject Author Views Date
Thread GT::Session::File problems webmaster33 5403 May 8, 2003, 9:15 AM
Thread Re: [webmaster33] GT::Session::File problems
Paul 5257 May 8, 2003, 12:11 PM
Thread Re: [Paul] GT::Session::File problems
webmaster33 5258 May 8, 2003, 1:27 PM
Thread Re: [webmaster33] GT::Session::File problems
Paul 5315 May 8, 2003, 1:54 PM
Thread Re: [Paul] GT::Session::File problems
webmaster33 5250 May 8, 2003, 2:49 PM
Thread Re: [webmaster33] GT::Session::File problems
Paul 5241 May 8, 2003, 2:52 PM
Thread Re: [Paul] GT::Session::File problems
webmaster33 5307 May 8, 2003, 2:56 PM
Post Re: [webmaster33] GT::Session::File problems
Paul 5291 May 8, 2003, 3:17 PM
Post Re: [webmaster33] GT::Session::File problems
webmaster33 5254 May 8, 2003, 3:11 PM
Post Re: [webmaster33] GT::Session::File problems
webmaster33 5268 May 8, 2003, 3:20 PM
Post Post deleted by webmaster33
webmaster33 5246 May 9, 2003, 11:13 AM
Thread Re: [webmaster33] GT::Session::File problems
webmaster33 5230 May 18, 2003, 9:35 AM
Thread Re: [webmaster33] GT::Session::File problems
Paul 5251 May 18, 2003, 10:24 AM
Thread Re: [Paul] GT::Session::File problems
webmaster33 5254 May 18, 2003, 11:18 AM
Thread Re: [webmaster33] GT::Session::File problems
Paul 5185 May 18, 2003, 11:37 AM
Post Re: [Paul] GT::Session::File problems
webmaster33 5223 May 18, 2003, 11:45 AM