Bug 41678

Summary: Add a warning when max servers are reached in SIP2
Product: Koha Reporter: Ryan Henderson <ryan.henderson>
Component: SIP2Assignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: martin.renvoize, ryan.henderson
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 41678: Add warning log when SIPServer reaches max_servers capacity

Description Ryan Henderson 2026-01-21 16:55:13 UTC
Hi All,

We've been investigating an issue with a SIP configuration with a library who have multiple SIP units.  It took us a while to find out that the issue was due to the max servers being reached. 

What would be a nice enhancement is adding a warning / error message into the sip logs to say that the max servers were reached. 

SIP2 is using prefork which from reading it seems to be able to provide this message which we currently don't seem to be doing. 

Kind regards,
Ryan.
Comment 1 Steven Raith 2026-01-21 17:05:34 UTC
For some flavour, we discovered this when we hadn't set a max_server config in the SIPConfig.xml as we were of the (apparently false!) impression that no max server statement = no limit.

It appears that the underlying subsystem Net::Server::PreFork has a default of 50 connections, but that's not apparent from the sip.log

Ideally it would just pop a simple MAX SERVERS REACHED or similar - it doesn't have to be fancy!
Comment 2 Martin Renvoize (ashimema) 2026-01-21 18:01:44 UTC
Created attachment 191809 [details] [review]
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.