working/SIPServer.git
10 years agoLP#1339190 Add support for the "Multiplex" personality user/blake/LP1339190
Mike Rylander [Wed, 11 Sep 2013 19:52:00 +0000 (15:52 -0400)]
LP#1339190 Add support for the "Multiplex" personality

We use Net::Server::Multiplex to reduce resource consumption.  In
this mode, SIPServer will maintain connection state in the main
listening process and fork workers as needed to handle individual
requests.

Initial implementation by Mike Rylander, with a conversion from
File::Queue to Memcache, and LOTS of debugging, by Bill Erickson.

Some highlights:

* A fork fence for max concurrent in-flight requests

* Allow the ILS to save state in IO::Multiplex mode

* Optimistic login using fork-and-check

When a SIP child process is spawned to handle a new connection login,
the pending login is tracked in the parent process (by PID) and the
child indicates to the parent that the login has succeeded by storing
login success/failure plus some state information in memcache.  Any time
the parent wakes up to process a message, it checks for completed logins
so they can be resolved as OK in the parent and the state information
is extracted and stored for future conversation with the resolved client.

* Let workers hang around for a bit for higher-rate clients

For some clients, such as AMH (sorters), the per-message connections
cause too much latency.  So, instead, we'll let their backends hang
around for a while.  This is controlled by a new attribute on the
server-params element, worker-keepalive, as a peer to the personality
value.  This value can also be set on the institution and login elements
to support finer-grained keepalive tuning.

This is measured in seconds and the default is 5. A value of 0 here
will disable this feature altogether.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Conflicts:

SIPServer.pm
Sip/MsgType.pm

Signed-off-by: Blake GH <blake@mobiusconsortium.org>
13 years agoCheck for sip_expire before trying to use it.
Thomas Berezansky [Thu, 31 Mar 2011 13:21:13 +0000 (09:21 -0400)]
Check for sip_expire before trying to use it.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
13 years agoAdd FID_PATRON_EXPIRE where required for export.
Jason Stephenson [Thu, 31 Mar 2011 13:19:52 +0000 (09:19 -0400)]
Add FID_PATRON_EXPIRE where required for export.

13 years agoPatron Expiration in PA
Thomas Berezansky [Thu, 31 Mar 2011 12:39:28 +0000 (08:39 -0400)]
Patron Expiration in PA

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
14 years agoAllow whitespace "lines" to be skipped during login
Joe Atzberger [Thu, 7 Oct 2010 19:48:56 +0000 (19:48 +0000)]
Allow whitespace "lines" to be skipped during login

This keeps clients who might have bad line-endings in the game.
In particular, this would help systems where an expect-driven login
process might be different than the rest of the client interaction.

14 years agoDie if no listeners in config, give better log messages
Joe Atzberger [Thu, 7 Oct 2010 19:40:38 +0000 (19:40 +0000)]
Die if no listeners in config, give better log messages

Also tighten debug messages: one warning at the end listing all failed is good enough.
Certainly better than just throwaway debug messages listing what we are going to try.
Otherwise if we succeeded, we don't need to know about the ones that failed, just
report the successful one.

14 years agoPerltidy and cleanup.
Joe Atzberger [Thu, 7 Oct 2010 19:34:54 +0000 (19:34 +0000)]
Perltidy and cleanup.

14 years agoVERSIONing, it's good for you.
Joe Atzberger [Fri, 1 Oct 2010 23:21:17 +0000 (23:21 +0000)]
VERSIONing, it's good for you.

14 years agoExtension for exposing patron internal ID via Patron Information
Joe Atzberger [Fri, 1 Oct 2010 19:57:55 +0000 (19:57 +0000)]
Extension for exposing patron internal ID via Patron Information

Used by some AMH systems

14 years agoSpec compliance on line-endings
Joe Atzberger [Thu, 30 Sep 2010 23:31:19 +0000 (23:31 +0000)]
Spec compliance on line-endings

\r not CRLF

14 years agoAn extra test from CASSIE
Joe Atzberger [Fri, 24 Sep 2010 01:34:17 +0000 (01:34 +0000)]
An extra test from CASSIE

Note: checksumming is still NOT recommendedl

14 years agoAdjust comment
Joe Atzberger [Wed, 30 Jun 2010 17:32:33 +0000 (17:32 +0000)]
Adjust comment

14 years agoItem Info extensions and general cleanup
Joe Atzberger [Wed, 23 Jun 2010 17:54:19 +0000 (17:54 +0000)]
Item Info extensions and general cleanup

14 years agoCleanup and adjustment
Joe Atzberger [Wed, 23 Jun 2010 17:40:24 +0000 (17:40 +0000)]
Cleanup and adjustment

bad_barcode is is better than berick for clarity.

14 years agoUpdate to current default EG values.
Joe Atzberger [Wed, 23 Jun 2010 17:38:11 +0000 (17:38 +0000)]
Update to current default EG values.

14 years agoStartup and shutdown scripts
Joe Atzberger [Tue, 22 Jun 2010 21:43:53 +0000 (21:43 +0000)]
Startup and shutdown scripts

Adapted from the versions I wrote for Koha SIP

14 years agoPerltidy/whitespace cleanup
Joe Atzberger [Tue, 22 Jun 2010 15:55:33 +0000 (15:55 +0000)]
Perltidy/whitespace cleanup

14 years agoTiny comment
Joe Atzberger [Tue, 22 Jun 2010 15:38:30 +0000 (15:38 +0000)]
Tiny comment

14 years agoDisable checksums in tests
Joe Atzberger [Fri, 11 Jun 2010 13:39:04 +0000 (13:39 +0000)]
Disable checksums in tests

Holds test disabled by default (for evergreen)

14 years agoPropagate $inst_id to checkout handler
Joe Atzberger [Thu, 3 Jun 2010 20:45:14 +0000 (20:45 +0000)]
Propagate $inst_id to checkout handler

Needed for holds routing logic

14 years agoAt least attempt to use the same formatting....
Joe Atzberger [Tue, 1 Jun 2010 18:51:28 +0000 (18:51 +0000)]
At least attempt to use the same formatting....

14 years agoCatch undef parameter (avoid warning/failure on substr)
Joe Atzberger [Tue, 1 Jun 2010 18:50:39 +0000 (18:50 +0000)]
Catch undef parameter (avoid warning/failure on substr)

14 years agoUse common vars from SIPtest (stop hardcoding individual tests)
Joe Atzberger [Tue, 1 Jun 2010 18:00:53 +0000 (18:00 +0000)]
Use common vars from SIPtest (stop hardcoding individual tests)

14 years agoWhitespace and stylistic cleanup only.
Joe Atzberger [Tue, 1 Jun 2010 17:57:57 +0000 (17:57 +0000)]
Whitespace and stylistic cleanup only.

14 years agoUse more of SIPtest.pm exported values, avoid hardcoding
Joe Atzberger [Tue, 1 Jun 2010 17:51:32 +0000 (17:51 +0000)]
Use more of SIPtest.pm exported values, avoid hardcoding

14 years agoNot an Exporter and not implemented
Joe Atzberger [Tue, 1 Jun 2010 17:50:35 +0000 (17:50 +0000)]
Not an Exporter and not implemented

14 years agoAvoid undef warning, provide lanuage failover to 000 (unknown/default)
Joe Atzberger [Tue, 1 Jun 2010 17:48:24 +0000 (17:48 +0000)]
Avoid undef warning, provide lanuage failover to 000 (unknown/default)

14 years agoPure stylistic and whitespace changes
Joe Atzberger [Tue, 1 Jun 2010 17:48:07 +0000 (17:48 +0000)]
Pure stylistic and whitespace changes

14 years agoFailover to language '000' (unknown/default)
Joe Atzberger [Tue, 1 Jun 2010 17:45:03 +0000 (17:45 +0000)]
Failover to language '000' (unknown/default)

14 years agoTighter indent
Joe Atzberger [Fri, 28 May 2010 18:38:07 +0000 (18:38 +0000)]
Tighter indent

14 years agoExecutable python script
Joe Atzberger [Fri, 28 May 2010 18:29:55 +0000 (18:29 +0000)]
Executable python script

14 years agoChecksum computation overhaul
Joe Atzberger [Mon, 24 May 2010 22:52:21 +0000 (22:52 +0000)]
Checksum computation overhaul

This adds advanced debugging of checksum computation.

Note: good sample data is lacking.  I think most of the actual
checksum lines included in the test are questionable.  The only
one that computes accurately seems to be the example from the
3M SIP Developers Guide that specifically addresses checksum
computation.  The others from the same guide seem invalid!

I think the debugging output suggests the implementation is
consistent with the specified instructions, despite unavailability
of sample data to confirm.

14 years agoDebug output capability
Joe Atzberger [Mon, 24 May 2010 22:51:27 +0000 (22:51 +0000)]
Debug output capability

14 years agowhitespace cleanup
Joe Atzberger [Mon, 24 May 2010 22:50:58 +0000 (22:50 +0000)]
whitespace cleanup

14 years agoExtra read_it catches telnet confirmation prompt
Joe Atzberger [Wed, 12 May 2010 22:07:36 +0000 (22:07 +0000)]
Extra read_it catches telnet confirmation prompt

14 years agoTests are executable
Joe Atzberger [Wed, 12 May 2010 21:49:47 +0000 (21:49 +0000)]
Tests are executable

14 years agoRobust string cleaning and flexible CRLF from Socket
Joe Atzberger [Wed, 12 May 2010 16:15:25 +0000 (16:15 +0000)]
Robust string cleaning and flexible CRLF from Socket

14 years agoSimple test showing telnet vs. RAW handling.
Joe Atzberger [Wed, 12 May 2010 15:54:05 +0000 (15:54 +0000)]
Simple test showing telnet vs. RAW handling.

14 years agoCleanup and more paranoid whitespace filtering
Joe Atzberger [Tue, 11 May 2010 15:25:01 +0000 (15:25 +0000)]
Cleanup and more paranoid whitespace filtering

14 years agoKill useless sub _count_tests
Joe Atzberger [Tue, 11 May 2010 04:55:33 +0000 (04:55 +0000)]
Kill useless sub _count_tests

14 years agoCorrect log message: Sip::MsgType::_initialize
Joe Atzberger [Tue, 11 May 2010 03:09:29 +0000 (03:09 +0000)]
Correct log message: Sip::MsgType::_initialize

not Sip::MsgType:_initialize (one colon)

14 years agoGet rid of weird evals, useless use's
Joe Atzberger [Tue, 11 May 2010 01:56:37 +0000 (01:56 +0000)]
Get rid of weird evals, useless use's

There are no scripts committed that use DATA handles, so those
eval blocks are not part of a known application.  And that
behavior is super sketchy, especially with multiple scripts, likely
in combination!

14 years agoLOG_ERROR is not a valid loglevel.
Joe Atzberger [Mon, 10 May 2010 22:27:12 +0000 (22:27 +0000)]
LOG_ERROR is not a valid loglevel.

LOG_ERR is.

14 years agoAppend extensions fields to checkin response
Joe Atzberger [Mon, 10 May 2010 22:11:18 +0000 (22:11 +0000)]
Append extensions fields to checkin response

14 years agoAdd back FID_HOME_LIBRARY
Joe Atzberger [Mon, 10 May 2010 22:10:07 +0000 (22:10 +0000)]
Add back FID_HOME_LIBRARY

14 years agoPatron password is a required field
Joe Atzberger [Mon, 10 May 2010 21:47:59 +0000 (21:47 +0000)]
Patron password is a required field

Alert type is part of the checkin extensions

14 years agoAdd 3M extension constants and structuralize EXPORT_TAGS
Joe Atzberger [Mon, 10 May 2010 21:37:13 +0000 (21:37 +0000)]
Add 3M extension constants and structuralize EXPORT_TAGS

14 years agoLOG_WARN is not a valid syslog loglevel
Joe Atzberger [Fri, 7 May 2010 01:22:35 +0000 (01:22 +0000)]
LOG_WARN is not a valid syslog loglevel

LOG_WARNING is.

14 years agoProper id (copy/paste error)
Joe Atzberger [Fri, 7 May 2010 01:09:27 +0000 (01:09 +0000)]
Proper id (copy/paste error)

14 years agoScript should be executable.
Joe Atzberger [Fri, 7 May 2010 00:11:08 +0000 (00:11 +0000)]
Script should be executable.

14 years agoAlarm messages that mean something.
Joe Atzberger [Fri, 7 May 2010 00:09:22 +0000 (00:09 +0000)]
Alarm messages that mean something.

Additional log messages, or log message content borrowed from my work on Koha.
Also some blasts of perltidy.

14 years agoAllow log ident string to be pulled from ENV
Joe Atzberger [Fri, 7 May 2010 00:02:24 +0000 (00:02 +0000)]
Allow log ident string to be pulled from ENV

This supports running multiple SIP interfaces on the same box,
even as the same user.

14 years agoInitial Commit
Joe Atzberger [Tue, 4 May 2010 19:21:23 +0000 (19:21 +0000)]
Initial Commit

From openncip.cvs.sourceforge.net:/cvsroot/openncip
.gitignore added