SIP2 accounts/institutions are stored in the database and the SIP server is supposed to reload its configuration when they change. In practice, after adding or editing a SIP2 account, most SIP worker processes keep serving the old configuration (e.g. new accounts get "SIP access not authorized") until the SIP server is restarted ( I tested multiple times over 30 minutes ). There seem to be two issues: * L1 cache flushed too late. process_request() calls _config_up_to_date() before Koha::Caches->flush_L1_caches(). The SIP parent reads sip2_resource_last_modified into its own L1 cache at startup and never flushes it. Every worker inherits that stale L1, so a worker's first connection compares against the startup-era value instead of the current shared value. * sip2_config_read_timestamp is stored in the shared (memcached) cache, but the configuration it tracks is per-process. When one worker reloads the config from the database, it bumps the shared timestamp, so every other worker then evaluates as "up to date" and never reloads its own stale in-memory config. Test Plan: 1) Configure the SIP server with several worker processes (e.g. set min_servers and max_servers to 5) and confirm an existing SIP2 account works 2) Add a new SIP2 account in the staff interface 3) Without restarting the SIP server, test the new account with misc/sip_cli_emulator.pl 4) Note the login fails 5) Apply this patch 6) Restart all the things! 7) Add another new SIP2 account 8) Without restarting the SIP server test this new account with sip_cli_emulator.pl 9) Note that the new account works! 10) prove t/db_dependent/SIP/SIPServer.t Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> |
||
|---|---|---|
| .. | ||
| ILS | ||
| Sip | ||
| ILS.pm | ||
| Logger.pm | ||
| Makefile | ||
| README | ||
| SIPServer.pm | ||
| Sip.pm | ||
| Trapper.pm | ||
README
README for Open NSIP 3M-SIP Server
DEPENDENCIES
SIPServer is written entirely in Perl, but it require these CPAN
perl modules to run:
Net::Server - The SIP server is a Net::Server::Prefork server
XML::LibXML
XML::Parser
XML::Simple - for parsing the config file
UNIVERSAL::require - for loading the correct ILS interface module
Clone - for running the test cases
LOGGING
SIPServer uses Koha::Logger for status and debugging messages.