Bugzilla – Attachment 68603 Details for
Bug 18725
process_message_queue.pl sends duplicate emails if message_queue is not writable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18725 - Process_message_queue sends duplicate emails if message_queue is not writable.
Bug-18725---Processmessagequeue-sends-duplicate-em.patch (text/plain), 1.80 KB, created by
Kyle M Hall (khall)
on 2017-10-26 13:06:10 UTC
(
hide
)
Description:
Bug 18725 - Process_message_queue sends duplicate emails if message_queue is not writable.
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-10-26 13:06:10 UTC
Size:
1.80 KB
patch
obsolete
>From 737f67639d555a29a48f9422c0ef9078f2ff8c80 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 26 Oct 2017 09:04:59 -0400 >Subject: [PATCH] Bug 18725 - Process_message_queue sends 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 >--- > misc/cronjobs/process_message_queue.pl | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/misc/cronjobs/process_message_queue.pl b/misc/cronjobs/process_message_queue.pl >index 3325c8a..bcc37e69 100755 >--- a/misc/cronjobs/process_message_queue.pl >+++ b/misc/cronjobs/process_message_queue.pl >@@ -28,6 +28,7 @@ BEGIN { > use C4::Letters; > use C4::Log; > use Getopt::Long; >+use Koha::Notice::Messages; > > my $username = undef; > my $password = undef; >@@ -63,5 +64,9 @@ die $usage if $help; > > cronlogaction(); > >+my $msg = Koha::Notice::Message->new({ message_transport_type => 'email' })->store(); >+die("The message_queue table does not appear to be writeable") unless $msg->id; >+$msg->delete(); >+ > C4::Letters::SendQueuedMessages( { verbose => $verbose, username => $username, password => $password, method => $method } ); > >-- >2.10.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18725
:
64803
|
65625
|
68602
|
68603
|
70805
|
70826
|
70853
|
70876
|
73277
|
73278
|
73749
|
73750
|
73751
|
74143
|
74247