Bug 18725: Prevent process_message_queue to send duplicate emails if message_queue...
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 26 Oct 2017 13:04:59 +0000 (09:04 -0400)
committerNick Clemens <nick@bywatersolutions.com>
Tue, 22 May 2018 09:58:13 +0000 (09:58 +0000)
commita1e044094b2c29024dfe66b76c7bf2c619be0c7a
tree3354bcd9aeca3da7f6254495770dd38a949362d1
parentcdbe6e1094681da04778e02e0d817dcd00cf6ed3
Bug 18725: Prevent process_message_queue to send duplicate emails if message_queue is not writable.

Last week, we had a database server whose disk filled, causing database writes to fail.

This meant that messages in message_queue marked 'pending' were not marked as 'sent' when they were added to the postfix mail queue; messages were sent every 15 minutes (as specified in the cron job) until the disk space issues were cleared.

I would suggest adding a token write to the start of process_message_queue.pl as a 'canary in the coal mine'. If the database write fails, process_message_queue should stop, because it's not safe to proceed sending emails that may not be marked 'sent'.

Test Plan:
1) Apply this patch
2) Make the message_queue table unwriteable somehow
3) Run process_message_queue.pl
4) Script should die with error

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Letters.pm