Hallo,
bis jetzt habe ich noch nicht herausgefunden, warum die Verarbeitung im Kleinanzeigenprogramm so beeinträchtigt ist.
Nachforschungen zu LOCK, Standard Timeout haben mich zu einer Datei routines.pl geführt, wo mir die u. a. Routine/Sub aufgefallen ist:
sub exclusive_lockfile {# check to see if we got an exclusive lock on the file
# and if not, sleep 1 second and try again until we have
# tried for a total of 20 seconds. If we could not get
# an exclusive lock within 20 seconds, let's exit with an
# error message.
my ($file_handle) = @_;
$lock_file = "$file_handle.lock";
$sleep_count = 0;
$request = "$as{'request'}";
if (-M "$require_path/$file_handle/$lock_file" > .001) {
unlink("$require_path/$file_handle/$lock_file");
rmdir("$require_path/$file_handle");
&log_flock($file_handle, "Forced Unlock Performed", $request);
}
# perform a check for a lock that may have gotten left behind
# because an error occurred previously.
while ($sleep_count < 20) {
if (!-e "$require_path/$file_handle") {
mkdir("$require_path/$file_handle", 0777);
chmod(0777, "$require_path/$file_handle");
open(LOCK_FILE, ">$require_path/$file_handle/$lock_file");
flock(LOCK_FILE, 2) if ($flock == 1);
last;
} else {
$sleep_count++;
if ($sleep_count > 19) {
&log_flock($file_handle, "Standard Timeout", $request);
&error_cannot_lock;
}
sleep(1);
next;
}
} # end of while
} # end of sub
Meine Vermutung ist, das die Routine für die Fehlermeldung, das Sperren verantwortlich ist.
1. Das Programm ist schon jahrelang im Einsatz, warum gibt es den Fehler erst seit ca. 4 Wochen?
2. Kann mir(als Perl-Laie) jemand genau erklären, was die Funktion macht?
Vielen Dank für jeden Tipp zur Fehlerbehebung.
Gruss
joseph
Datum: 27.10.2007-15:07
