[Bug 31033] New: SIP2 does not correctly handle multiple simultaneous connections
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Bug ID: 31033 Summary: SIP2 does not correctly handle multiple simultaneous connections Change sponsored?: --- Product: Koha Version: 21.11 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: SIP2 Assignee: koha-bugs@lists.koha-community.org Reporter: marka@pobox.com QA Contact: testopia@bugs.koha-community.org If two connections are made to the SIP2 server simultaneously, the second connection does not receive any replies until the first connection is closed. Here is how I reproduced the problem: In terminal #1, use 'telnet koha.ourlibrary.com 6001' to connect to the SIP2 server. Send a 9300CN message to log into SIP2. The SIP2 server sends back the expected 941 response. In terminal #2, use telnet in the same way to connect to the SIP2 server. Then try sending the 9300CN message to log in. The SIP2 does not send any response. In terminal #1, close the telnet connection. Now terminal #2 receives its expected 941 message. This problem was discovered by Lyrasis, a content provider that we are trying to integrate with our library's Koha installation. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #1 from David Cook <dcook@prosentient.com.au> --- That's quite interesting. Using koha-testing-docker, I ran "telnet localhost 6001" from two different terminals. In a third terminal, I ran the following "ss -l -n -t" and I can see that the SIP process listening on 127.0.0.1:6001 has 1 connection in its TCP "listen" backlog. While the telnet client says it's connected, that just mean it's connected to the server's network stack. Only one connection has actually been accepted by the application. (This would probably be clear from your prod syslog as well.) Looking at the "server-params" in the SIPconfig.xml file, it looks like min_servers = 1 and min_spare_servers = 0. In theory, 0 should be fine because that should just means 0 spare servers... When I change min_spare_servers to = 1, the forking seems to work correctly. If there are no current connections, then there is only 1 child process. If there are current connections, then it keeps 1 extra connection around. I'd say it's a bug/quirk in Net::Server::PreFork which powers the SIP server. Since it looks like the SIP server has accidentally been using a max of 1 child process, we should probably set some limits on maximums since the default max server is 50. The default max spare servers is 10... -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Mark, your problem is solvable by changing your SIPconfig.xml file, but I think this bug is worth keeping open for now, as maybe we should change the defaults for the Koha SIP server, or at least add some comments to make it clear how it works. -- 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=31033 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- It looks like Net::Server::Prefork subclasses Net::Server::PreForkSimple which subclasses Net::Server and I'm not sure that the "max_server" configuration item actually gets passed along correctly... So I'm going to add a default of "1" for Koha since that seems to be what's used in practice... In your case, I'd say just add "max_servers='2'" or whatever you need to support your situation. -- 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=31033 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=31033 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- Created attachment 136470 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136470&action=edit Bug 31033: Explicitly define max child processes for SIP server By default, the SIP server appears to only use 1 child process for responding to SIP connections. This change makes this explicit in the configuration, which should make it so that people who need more than 1 simultaneous SIP connection can know to just increase the value for the "max_servers" parameter in the SIPconfig.xml file. Test plan: 1. Add "max_servers='1'" to your SIP configuration file 2. koha-sip --restart kohadev 3. Open 3 terminals 4. Run "telnet localhost 6001" on 2 terminals 5. On the 3rd terminal, run the following: ss -l -n -t ps -efww | grep "sip" 6. Note that there are 2 processes called kohadev-koha-sip: perl /kohadevbox/koha/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml One of these processes is the parent of the other 7. The Recv-Q in the "ss" output should show 1 (This means that 1 of your telnet connections is in the server's TCP backlog) 8. Celebrate as the configuration works as expected -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|21.11 |master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 --- Comment #5 from Mark Alexander <marka@pobox.com> --- Thanks. Setting max_servers to '2' works for my use case with two simultaneous connections. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- (In reply to Mark Alexander from comment #5)
Thanks. Setting max_servers to '2' works for my use case with two simultaneous connections.
Great. Glad I was able to help. I enjoy networking issues heh. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136470|0 |1 is obsolete| | --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 139020 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139020&action=edit Bug 31033: Explicitly define max child processes for SIP server By default, the SIP server appears to only use 1 child process for responding to SIP connections. This change makes this explicit in the configuration, which should make it so that people who need more than 1 simultaneous SIP connection can know to just increase the value for the "max_servers" parameter in the SIPconfig.xml file. Test plan: 1. Add "max_servers='1'" to your SIP configuration file 2. koha-sip --restart kohadev 3. Open 3 terminals 4. Run "telnet localhost 6001" on 2 terminals 5. On the 3rd terminal, run the following: ss -l -n -t ps -efww | grep "sip" 6. Note that there are 2 processes called kohadev-koha-sip: perl /kohadevbox/koha/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml One of these processes is the parent of the other 7. The Recv-Q in the "ss" output should show 1 (This means that 1 of your telnet connections is in the server's TCP backlog) 8. Celebrate as the configuration works as expected Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139020|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 139687 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139687&action=edit Bug 31033: Explicitly define max child processes for SIP server By default, the SIP server appears to only use 1 child process for responding to SIP connections. This change makes this explicit in the configuration, which should make it so that people who need more than 1 simultaneous SIP connection can know to just increase the value for the "max_servers" parameter in the SIPconfig.xml file. Test plan: 1. Add "max_servers='1'" to your SIP configuration file 2. koha-sip --restart kohadev 3. Open 3 terminals 4. Run "telnet localhost 6001" on 2 terminals 5. On the 3rd terminal, run the following: ss -l -n -t ps -efww | grep "sip" 6. Note that there are 2 processes called kohadev-koha-sip: perl /kohadevbox/koha/C4/SIP/SIPServer.pm /etc/koha/sites/kohadev/SIPconfig.xml One of these processes is the parent of the other 7. The Recv-Q in the "ss" output should show 1 (This means that 1 of your telnet connections is in the server's TCP backlog) 8. Celebrate as the configuration works as expected Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Trivial improvement, works.. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- I have no idea what's going on, but in production this is breaking SIP! No errors in the logs. Is anyone else experiencing this? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 --- Comment #12 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Kyle M Hall from comment #11)
I have no idea what's going on, but in production this is breaking SIP! No errors in the logs. Is anyone else experiencing this?
Ignore this^ I had set max lower than min. That was my bad. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 --- Comment #13 from David Cook <dcook@prosentient.com.au> --- (In reply to Kyle M Hall from comment #11)
I have no idea what's going on, but in production this is breaking SIP! No errors in the logs. Is anyone else experiencing this?
I had an issue with SIP today although it wasn't the max_servers. It was that min_spare_servers was set to 0. (In reply to David Cook from comment #1)
Looking at the "server-params" in the SIPconfig.xml file, it looks like min_servers = 1 and min_spare_servers = 0. In theory, 0 should be fine because that should just means 0 spare servers...
When I change min_spare_servers to = 1, the forking seems to work correctly. If there are no current connections, then there is only 1 child process. If there are current connections, then it keeps 1 extra connection around.
I'd say it's a bug/quirk in Net::Server::PreFork which powers the SIP server.
Since it looks like the SIP server has accidentally been using a max of 1 child process, we should probably set some limits on maximums since the default max server is 50. The default max spare servers is 10...
The real issue is min_spare_servers... I think my intention here was that min_servers='1' and min_spare_servers='0' implies a max_servers='1'. But if you change max_servers='10', it won't make a difference until you change "min-spare_servers" to at least 1. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|SIP2 does not correctly |SIP2 configuration does not |handle multiple |correctly handle multiple |simultaneous connections |simultaneous connections by | |default --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I've rephrased the bug title a bit as I had already someone asking if Koha can't currently support multiple devices from reading it - just a configuration issue! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Can you please document this bugfix correctly for the release notes? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 --- Comment #16 from David Cook <dcook@prosentient.com.au> --- (In reply to Tomás Cohen Arazi from comment #15)
Can you please document this bugfix correctly for the release notes?
Well it's not a bugfix. It's just making the configuration more explicit, although perhaps not explicit enough. Perhaps we should be adding comments in the SIPconfig.xml to make it clearer on how to configure it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 --- Comment #17 from David Cook <dcook@prosentient.com.au> --- Looking back at the commit message... I need to take another look at this in koha-testing-docker to double-check the wording... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 --- Comment #18 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Please add some release notes so people notice it. It is a good thing to advertise. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00 |22.11.00, 22.05.06 released in| | CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable --- Comment #19 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for upcoming 22.05.06 release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to stable |RESOLVED CC| |victor@tuxayo.net --- Comment #20 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00, 22.05.06 |22.11.00,21.11, 22.05.06 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 --- Comment #21 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Thanks! Pushed to 21.11 for 21.11.12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00,21.11, 22.05.06 |22.11.00,22.05.06,21.11.12 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31033 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org