https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41707

--- Comment #10 from Kyle M Hall (khall) <[email protected]> ---
Created attachment 202527
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202527&action=edit
Bug 41707: (QA follow-up) Remove the SIP DIE handler, log fatal errors where
they are caught instead

The root of the log flooding is that a __DIE__ handler fires for every
die, including exceptions that are thrown and caught as part of normal
operation deep inside DBIC and Net::Server. The stack walk added by the
previous patch stops after 10 frames, which is why it filters the DBIC
noise, but it would also silently drop a genuine fatal error thrown
more than 10 frames from the nearest C4::SIP frame, such as a lost
database connection inside DBIC. That brings back the problem bug
39911 was written to fix.

The reason fatal errors were invisible in the first place (the problem
bug 39911 worked around) is that sip_protocol_loop wraps all message
handling in an eval and silently discards every non-timeout error.

This patch removes the DIE handler entirely and instead logs errors at
the two places they are actually caught. sip_protocol_loop now logs
the error it has been throwing away before shutting down the
connection. The transport dispatch in process_request is wrapped in an
eval to catch anything fatal outside the protocol loop, such as the
login phase, where the error is logged and rethrown. Handled
exceptions never reach the log.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/SIP/Trapper.t
3) Restart the SIP server
4) Run: misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 -l
MPL --patron koha -m patron_information
5) Note the DBIx::Class errors from comment 4 no longer flood the SIP logs
6) Add a "die 'TEST';" to handle_patron_info in C4/SIP/Sip/MsgType.pm,
   restart the SIP server
7) Repeat step 4
8) Note "TEST" is logged as an error in the SIP logs!

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to