[koha-commits] main Koha release repository branch 3.22.x updated. v3.22.18-7-g45e686c

Git repo owner gitmaster at git.koha-community.org
Fri Mar 31 15:31:16 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "main Koha release repository".

The branch, 3.22.x has been updated
       via  45e686c842dc684ca6d55793fd2f3a49fcac7ffa (commit)
       via  59f43610aca9f99c36004a7a3bd638a497c59e40 (commit)
      from  093f902eafe4f721f88445ee3f5ef440c9768f30 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 45e686c842dc684ca6d55793fd2f3a49fcac7ffa
Author: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Date:   Thu Feb 9 12:44:38 2017 +0100

    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 at veron.ch>
    
    Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>
    
    Signed-off-by: Brendan A Gallagher <brendan at bywatersolutions.com>
    (cherry picked from commit be156d9ad9e5bcfadab34d44f90e04fd61e256ad)
    Signed-off-by: Katrin Fischer <katrin.fischer.83 at web.de>
    (cherry picked from commit ab23d1368343ad115a5072f7264b99c7bee68675)
    Signed-off-by: Julian Maurice <julian.maurice at biblibre.com>

commit 59f43610aca9f99c36004a7a3bd638a497c59e40
Author: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Date:   Thu Feb 9 12:13:07 2017 +0100

    Bug 15854: Simplify the code to limit race conditions
    
    There is an obvious race condition when CHECKIN and RENEWAL are
    generated from circulation.pl calling svc/renew or svc/checkin in AJAX.
    
    The 2 first queries will try to get the id of the last message
    (find_last_message) and if it does not exist, they will insert it.
    Theorically that could be lead to have several "digest" messages for a
    given patron.
    I did not recreate more than 2 messages, from the third one at least one
    of the two firsts existed in the DB already.
    
    This patch just simplifies the code to make the SELECT and INSERT or
    UPDATE closer and limit the race condition possibilities.
    
    Test plan:
    0. Set RenewalSendNotice and circ rules to have a lot of renewals available
    1. Use batch checkouts (or one by one) to check out several items to a
    patron
    2. Empty message_queue (at least of this patron)
    3. Renew them all at once ("select all" link, "renew or check in"
    button)
    4. Check the message_queue
    Without this patch you have lot of chances to faced a race condition and
    get at least 2 messages for the same patron. This is not expected, we
    expect 1 digest with all the messages.
    With this patch apply you have lot of chances not to face it, but it's
    not 100% safe as we do not use a mechanism to lock the table at the DBMS
    level.
    
    Tested both patches together, works as expected.
    Signed-off-by: Marc Véron <veron at veron.ch>
    
    Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>
    
    Signed-off-by: Brendan A Gallagher <brendan at bywatersolutions.com>
    (cherry picked from commit 607b14516a955c9989e4764c69527edbc1f36ba0)
    Signed-off-by: Katrin Fischer <katrin.fischer.83 at web.de>
    (cherry picked from commit bdae6c9492ea8db223c03753090060592a330be7)
    Signed-off-by: Julian Maurice <julian.maurice at biblibre.com>

-----------------------------------------------------------------------

Summary of changes:
 C4/Circulation.pm |   64 ++++++++++++++++++++++-------------------------------
 1 file changed, 27 insertions(+), 37 deletions(-)


hooks/post-receive
-- 
main Koha release repository


More information about the koha-commits mailing list