[Bug 41678] New: Add a warning when max servers are reached
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41678 Bug ID: 41678 Summary: Add a warning when max servers are reached Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: SIP2 Assignee: koha-bugs@lists.koha-community.org Reporter: ryan.henderson@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org 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. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41678 Ryan Henderson <ryan.henderson@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add a warning when max |Add a warning when max |servers are reached |servers are reached in SIP2 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41678 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41678 Ryan Henderson <ryan.henderson@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ryan.henderson@openfifth.co | |.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41678 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41678 --- Comment #1 from Steven Raith <steven.raith@openfifth.co.uk> --- 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! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41678 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41678 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 191809 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191809&action=edit 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41678 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I had a look, but there are some things not quite right: 1) The attached patch has the sub and POD, but I can't see where it would be called? Maybe there is some automatism I am not aware of? 2) Test plan is missing :( 3) QA tests are failing: Processing files [RUNNING] C4/SIP/SIPServer.pm [FAIL] C4/SIP/SIPServer.pm Result: [FAIL] C4/SIP/SIPServer.pm SKIP pod_coverage No POD exists FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl C4/SIP/SIPServer.pm` FAIL valid ERROR: can't load appenderclass 'Log::Log4perl::Appender::File' Compilation error Processing additional checks PASS! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41678 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |Main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41678 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41678 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191809|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41678 --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 203202 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203202&action=edit 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 check is implemented in idle_loop_hook, which Net::Server::PreFork calls repeatedly, in the parent process, for the life of the server, once child processes exist. pre_loop_hook was considered first but doesn't work for this: it is called exactly once, before the accept loop starts and before any child has been forked, so it can never observe a nonzero child count. idle_loop_hook only ever runs in the parent/arbiter process, never in the child processes that handle SIP protocol traffic, so this adds no overhead to the per-transaction hot path. The check itself is throttled to once per second, and Net::Server::PreFork already performs comparable or heavier accounting (time() calls, full scans of the children hash, child liveness probes) on every pass of the same parent loop. Test plan: 1) Apply the patch and confirm it compiles and lints cleanly: perl -c C4/SIP/SIPServer.pm perl misc/devel/tidy.pl C4/SIP/SIPServer.pm Both should report no issues / no changes needed. 2) Run the unit tests: prove t/db_dependent/SIP/SIPServer.t All subtests should pass, including the new idle_loop_hook tests. 3) Functional test: - Set max_servers to a small value (e.g. 2) in the SIP2 config for a test instance. - Start the SIP server and open enough concurrent SIP2 connections (e.g. via telnet/nc to the configured port) to reach that count. - Tail the SIP log (the 'sip' log4perl category, e.g. /var/log/koha/<instance>/sip-error.log) and confirm a WARNING line appears: "SIPServer at maximum capacity: 2/2 child processes running" - Confirm it logs at most once per second while at capacity, and stops once a connection closes and the child count drops below max_servers. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org