Bugzilla – Attachment 191809 Details for
Bug 41678
Add a warning when max servers are reached in SIP2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41678: Add warning log when SIPServer reaches max_servers capacity
9dfcd71.patch (text/plain), 1.78 KB, created by
Martin Renvoize (ashimema)
on 2026-01-21 18:01:44 UTC
(
hide
)
Description:
Bug 41678: Add warning log when SIPServer reaches max_servers capacity
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-01-21 18:01:44 UTC
Size:
1.78 KB
patch
obsolete
>From 9dfcd71dc1b065d35a9c2d039ed2a566ed3a2cbc Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Wed, 21 Jan 2026 17:59:42 +0000 >Subject: [PATCH] Bug 41678: Add warning log when SIPServer reaches max_servers > capacity > >This enhancement adds logging to warn administrators when the SIP server >reaches its configured maximum number of child processes. The warning is >logged periodically (once per second) when the current child count equals >or exceeds the max_servers configuration value. > >The implementation uses the pre_loop_hook to check capacity in the parent >process and logs using the existing SIP logging system at WARNING level. >--- > C4/SIP/SIPServer.pm | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > >diff --git a/C4/SIP/SIPServer.pm b/C4/SIP/SIPServer.pm >index cd407fda738..6bf84f6ef8a 100644 >--- a/C4/SIP/SIPServer.pm >+++ b/C4/SIP/SIPServer.pm >@@ -656,6 +656,33 @@ sub get_timeout { > } > } > >+=head2 pre_loop_hook >+ >+This hook is called before the main server loop starts. >+We use it to periodically check if we're at max_servers capacity and log a warning. >+ >+=cut >+ >+sub pre_loop_hook { >+ my $self = shift; >+ >+ # Only check in the parent process >+ return unless $self->is_parent; >+ >+ # Limit checks to once per second to avoid excessive logging >+ state $last_check = 0; >+ return if time - $last_check < 1; >+ $last_check = time; >+ >+ my $server_props = $self->{server}; >+ my $max_servers = $server_props->{max_servers}; >+ my $current_children = scalar keys %{$server_props->{children} // {}}; >+ >+ if ($max_servers && $current_children >= $max_servers) { >+ siplog('LOG_WARNING', "SIPServer at maximum capacity: %d/%d child processes running", $current_children, $max_servers); >+ } >+} >+ > 1; > > __END__ >-- >2.52.0 >
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 41678
: 191809