Koha/C4
Jonathan Druart be156d9ad9 Bug 15854: Use a READ and WRITE LOCK on message_queue
To make sure we will not never get a race conditions for these kinds of
notices, we need to add a LOCK on the message_queue table.

This does not smell the best way to do that, but I faced deadlock issues
when I tried to use "UPDATE FOR"

https://dev.mysql.com/doc/refman/5.7/en/innodb-locking-reads.html
https://dev.mysql.com/doc/refman/5.7/en/lock-tables.html
https://dev.mysql.com/doc/refman/5.7/en/commit.html

To test this patch, or another solution, you need to apply manually this
change:

         my $message = C4::Message->find_last_message($borrower, $type, $mtt);
         unless ( $message ) {
+            sleep(1);
             C4::Message->enqueue($letter, $borrower, $mtt);
         } else {

And repeat the test plan from first patch.
Do not forget to truncate the message_queue table.

Followed test plans, works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
2017-03-23 00:47:28 +00:00
..
AuthoritiesMarc
Barcodes
ClassSortRoutine
Creators Bug 18044: Label Batches not displaying 2017-02-07 17:46:00 +00:00
External
Form Bug 16259: Replace CGI->param with CGI->multi_param in list context - part 2 2016-05-16 17:28:06 +00:00
Heading
ILSDI Bug 17836: (ILSDI) Make GetPatronInfo fill 'charges' correctly 2017-01-20 13:44:56 +00:00
Installer Bug 16034 follow-up: added WebService::ILS to PerlDependencies 2017-02-21 19:58:21 +00:00
Labels
Linker
Members
OAI
Output
Patroncards
Reports Bug 17535: Fix search for reports by keywords 2016-11-07 16:38:25 +00:00
Search Bug 17323: Column search_history.time cannot be null 2016-11-18 13:51:37 +00:00
Serials
SIP Bug 17196: Move marcxml out of the biblioitems table 2017-01-13 13:49:26 +00:00
Utils Bug 18094: Only search in searchable patron attributes if searching in standard fields 2017-03-22 21:12:43 +00:00
Accounts.pm Bug 17894 - Remove and replace WriteOffFee 2017-01-19 11:15:26 +00:00
Acquisition.pm Bug 18256: Koha::Items - Remove GetItemsCount 2017-03-22 19:18:15 +00:00
Auth.pm BUG 8010: Correct a few syntax errors, and moved tests 2017-03-22 19:01:28 +00:00
Auth_cas_servers.yaml.sample
Auth_with_cas.pm Bug 17481: Fix incorrect merge of bug 11048 (logout redirection for CAS authentication) 2016-11-07 16:34:57 +00:00
Auth_with_ldap.pm Bug 17775 - Add new user with LDAP not works under Plack 2017-02-07 17:45:13 +00:00
Auth_with_shibboleth.pm
AuthoritiesMarc.pm Bug 18070: Correct error from podchecker on line 1376 2017-03-03 18:12:10 +00:00
BackgroundJob.pm
Barcodes.pm
Biblio.pm Bug 18284: (bug 17196 follow-up) Move biblio metadata when a biblio is deleted 2017-03-22 10:26:05 +00:00
Bookseller.pm Bug 13726: Make Koha::Acq::Bookseller using Koha::Object 2016-12-30 11:54:32 +00:00
Boolean.pm
Breeding.pm
Budgets.pm Bug 16123 - Display budget hierarchy in the budget dropdown menu used when placing a new order 2016-10-28 15:26:00 +00:00
Calendar.pm
Charset.pm
Circulation.pm Bug 15854: Use a READ and WRITE LOCK on message_queue 2017-03-23 00:47:28 +00:00
ClassSortRoutine.pm
ClassSource.pm Bug 17208: Checking if classification source or filing rule already exists before adding 2016-12-23 11:33:48 +00:00
Context.pm Bug 17486: [QA Follow-up] Changes as to set_userenv 2017-01-13 12:32:20 +00:00
Contract.pm
CourseReserves.pm
Creators.pm
Debug.pm
Heading.pm
HoldsQueue.pm Bug 14514 - LocalHoldsPriority and the HoldsQueue conflict with each other 2016-10-11 15:44:47 +00:00
HTML5Media.pm Bug 17501: Remove Koha::Upload::get from Koha::Upload 2017-01-20 14:20:05 +00:00
Images.pm
ImportBatch.pm Bug 18070: [Follow-up] What should DelAuthority return? 2017-03-03 18:12:09 +00:00
ImportExportFramework.pm Bug 17389: Clear logs 2016-10-11 16:18:10 +00:00
InstallAuth.pm
Installer.pm Bug 18215: Fix another tls warning 2017-03-22 21:00:41 +00:00
ItemCirculationAlertPreference.pm
Items.pm Bug 18256: Koha::Items - Remove GetItemsCount 2017-03-22 19:18:15 +00:00
Koha.pm Bug 17846: Remove get_infos_of declaration 2017-02-17 15:35:40 +00:00
Labels.pm
Languages.pm
Letters.pm Bug 17962: TT syntax for notices - Prove that ACQ_NOTIF_ON_RECEIV is compatible 2017-02-17 11:43:46 +00:00
Linker.pm
Log.pm
MarcModificationTemplates.pm
Matcher.pm Bug 14629 - Add aggressive ISSN matching feature equivalent to the aggressive ISBN matcher 2016-10-28 11:58:14 +00:00
Members.pm Bug 16966: Koha::Patrons - Move GetBorrowersWithIssuesHistoryOlderThan to search_patrons_to_anonymise 2017-03-03 17:20:03 +00:00
Message.pm
NewsChannels.pm
Output.pm
Overdues.pm Bug 17968: Remove useless variable $item_format in C4::Overdues::parse_overdues_letter 2017-02-17 15:43:30 +00:00
Patroncards.pm
Print.pm
Record.pm Bug 17196: [QA Follow-up] Adjust some text on marcxml 2017-01-13 13:49:30 +00:00
Reports.pm
Reserves.pm Bug 17995 - HOLDPLACED notice should have access to the reserves table 2017-03-23 00:37:17 +00:00
Ris.pm Bug 16245: [QA Follow-up] Replace typeofrecord2 by biblevel 2016-10-21 14:51:55 +00:00
RotatingCollections.pm
Scheduler.pm
Scrubber.pm
Search.pm Bug 17764: (bug 17556 follow-up) Fix search for logged out users and lost items 2016-12-22 20:25:05 +00:00
Serials.pm Bug 17865 'If a subscription has no history end date, it shows as expired today in OPAC' 2017-02-21 19:55:13 +00:00
Service.pm
ShelfBrowser.pm
SMS.pm Bug 13029 : Follow up 2016-12-16 11:33:39 +00:00
SocialData.pm
Stats.pm
Suggestions.pm
Tags.pm
Templates.pm Bug 18010: Remove potential exposure from gettemplate 2017-03-23 00:36:12 +00:00
TmplToken.pm
TmplTokenType.pm
TTParser.pm
UsageStats.pm Bug 18066: Use https for ws 2017-03-23 00:10:46 +00:00
XISBN.pm
XSLT.pm Bug 18089 - All XSLT testing singleBranchMode = 0 fails to show even if install has only 1 branch 2017-02-14 14:07:02 +00:00