Again a BUG in GT::Session::File module.
There is no file locking used in this module at all!
...
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
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...
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
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...