Bug 10559 - noisy statement handle still active warnings when generating notices
Summary: noisy statement handle still active warnings when generating notices
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Galen Charlton
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-09 17:52 UTC by Galen Charlton
Modified: 2014-12-07 20:02 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments
bug 10559: remove spurious "statement handle still active" warnings (1.52 KB, patch)
2013-07-09 18:07 UTC, Galen Charlton
Details | Diff | Splinter Review
[SIGNED-OFF] bug 10559: remove spurious "statement handle still active" warnings (1.56 KB, patch)
2013-07-17 03:59 UTC, Srdjan Jankovic
Details | Diff | Splinter Review
bug 10559: remove spurious "statement handle still active" warnings (1.63 KB, patch)
2013-07-18 14:20 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Galen Charlton 2013-07-09 17:52:14 UTC
Running a cronjob that produces notices can generate warning messages like this:

$ ./misc/cronjobs/overdue_notices.pl -t -library CPL
prepare_cached(SELECT * FROM issues WHERE     itemnumber = ?) statement handle DBI::st=HASH(0x54a7828) still Active at C4/Letters.pm line 589

These warnings don't appear to reflect any functionality breakage, but there's no reason to have the noise cluttering up cronjob logs.
Comment 1 Galen Charlton 2013-07-09 18:07:26 UTC Comment hidden (obsolete)
Comment 2 Srdjan Jankovic 2013-07-17 03:59:30 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2013-07-18 14:19:41 UTC
QA comment:

This patch removes the warnings.
Koha uses many bad uses of $sth->finish(). Maybe it would be great to add a comment for this one.

Marked as Passed QA.
Comment 4 Jonathan Druart 2013-07-18 14:20:05 UTC
Created attachment 19769 [details] [review]
bug 10559: remove spurious "statement handle still active" warnings

Generating (e.g.) overdue notices can result in spurious warnings in
the cronjob logs:

$ ./misc/cronjobs/overdue_notices.pl -t -library CPL
prepare_cached(SELECT * FROM issues WHERE     itemnumber = ?) statement handle DBI::st=HASH(0x54a7828) still Active at C4/Letters.pm line 589

This patch removes the warning by making sure that the relevant statement
handle is finished after fetching its first row of results.

To test:

[1] Set up an overdue loan such that running overdue_notices.pl will
    trigger the generation of a notice.
[2] Run overdue_notices.pl -t and note the warning message.
[3] Apply the patch.
[4] Run overdue_notices.pl -t again and note that the warning message
    is no longer displayed.
[5] Check the message_queue table and verify that the overdue
    notices generated in steps 2 and 4 have the same text.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 5 Galen Charlton 2013-07-18 15:29:49 UTC
Pushed to master.
Comment 6 Tomás Cohen Arazi 2013-08-14 14:32:53 UTC
This patch has been pushed to 3.12.x, will be in 3.12.4.

Thanks Galen!
Comment 7 Bernardo Gonzalez Kriegel 2013-09-13 21:22:30 UTC
Pushed to 3.10.x, will be in 3.10.11
Comment 8 Chris Hall 2013-09-15 05:24:34 UTC
Pushed to 3.8.x, will be in 3.8.18.