[Koha-bugs] [Bug 18725] Process_message_queue sends duplicate emails if message_queue is not writable.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Aug 11 11:57:29 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18725

Marcel de Rooy <m.de.rooy at rijksmuseum.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Signed Off                  |Failed QA

--- Comment #5 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
+    my $lock_sth = $dbh->prepare('LOCK TABLES message_queue WRITE');
+    my $attempts = 0;
+    until ( $sth->execute() ) {
+        $attempts++;
+        die 'Unable to lock message_queue to update message status: ' .
$dbh->errstr() if $attempts > 10;
+        sleep 1;
+    }
+
     my $result = $sth->execute( $params->{'status'},
                                 $params->{'message_id'} );

Hey, you are executing on $sth while you probably meant $lock_sth. You only
prepare the lock, and start fake updating with two undefs.

Overall, this seems not a good idea to me. We had problems with locking tables
already and you should not lock when we run Letters.t since the lock does a
commit. Note that we had a test for prove and an env variable
KOHA_NO_TABLE_LOCKS.

If the disk is full, a lot of other jobs must fail too btw. Doesnt the job
crash on trying the update btw, or did it only send the same one mail each
time? If you cant write to disk, perhaps you could try to save this error
condition to the cache in memory ??
Note that processing mail will probably soon fail too without much disk space..

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list