Bugzilla – Attachment 182502 Details for
Bug 39911
Fatal errors from SIP server are not logged
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39911: Trap DIE signals in SIP server
Bug-39911-Trap-DIE-signals-in-SIP-server.patch (text/plain), 1.43 KB, created by
Kyle M Hall (khall)
on 2025-05-15 17:30:23 UTC
(
hide
)
Description:
Bug 39911: Trap DIE signals in SIP server
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2025-05-15 17:30:23 UTC
Size:
1.43 KB
patch
obsolete
>From 2f807976ffd8d7f44a2067fab3cf3f776bc9b178 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 15 May 2025 13:25:18 -0400 >Subject: [PATCH] Bug 39911: Trap DIE signals in SIP server > >At some point our SIP server stopped logging fatal errors to either logs or standard error. We should restore this vital functionality. > >Test Plan: >1) Apply the first patch which will cause the patron information request > to fail >2) Stop the SIP server >3) Start it again with: perl /kohadevbox/koha/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml >4) Trigger the failure with the following command: > ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su koha -sp koha -l MPL --patron koha -m patron_information >5) Note "THIS IS A TEST" is not found in logs or stderr >6) Apply the second patch >7) Repeat steps 2-4 >8) Note the error message is now visible from stderr at the command line > and also in the SIP log >--- > C4/SIP/Trapper.pm | 8 ++++++++ > 1 file changed, 8 insertions(+) > >diff --git a/C4/SIP/Trapper.pm b/C4/SIP/Trapper.pm >index cfbfd2aff0a..256e2166016 100644 >--- a/C4/SIP/Trapper.pm >+++ b/C4/SIP/Trapper.pm >@@ -56,4 +56,12 @@ sub BINMODE { > binmode( STDOUT, $mode ); > } > >+$SIG{__DIE__} = sub { >+ my $msg = shift; >+ my $logger = C4::SIP::Logger::get_logger(); >+ $logger->error($msg) if $logger; >+ warn $msg; # die doesn't output the message, warn before dying >+ die $msg; >+}; >+ > 1; >-- >2.39.5 (Apple Git-154)
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 39911
:
182501
|
182502
|
182503
|
182508