There appears to be a bug in Chromium where loading the same page
multiple times (without a refresh or cache clear) causes the
SharedWorker to fail to instantiate on every other page load.
Further research pending. Disabling SharedWorker's entirely for
now.
Note, to replicate, load a page using shared workers, focus the
browser address bar, hit Enter to load the page again. The shared
worker will fail to load on every other page load, though it will
appear to the SharedWorker caller (opensrf.js) that the port is open.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
It was falling behind the shared lib in bug fixes and features. A
per-tab WS implementation is (maybe) a dangerous thing to have around,
as well, since it encourages /many/ connections. Can resurrect later if
needed.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Bill Erickson [Mon, 3 Mar 2014 15:29:23 +0000 (10:29 -0500)]
LP#1268619: websocket: avoid module auto configuration
We don't want osrf_websocket_translator to be directly loaded as a
module, since it is not an apache module, but a shared library loaded by
an apache module (mod_websockets). This is especially true of the default
apache instance.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Added support for an idle timeout and idle check interval configuration
variables. These allow each websocket apache process to kick off
clients that have been connected and are idle for too long, thus hogging
a process unnecessarily.
Added a SIGUSR1 signal handler which forces the idle timeout to be very
low and a short re-check period so that the client can be kicked as soon
as there are no open conversations.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Avoid using ap_log_rerror, in particular referencing server->request
from the responder thread, since the request_rec will be invalid after
on_disconnect is called.
LP#1285915: document that perl2JSON doesn't order hash keys
This patch documents that JSON strings returned by
OpenSRF::Utils::JSON->perl2JSON() should not be expected to have
hash keys sorted in any particular order. It also adjusts a
corresponding test case to consistently pass under Perl 5.18, which
introduces hash order randomization.
Forcing JSON output to be in canonical form is another option, and
easily done by JSON::XS, but would add overhead.
Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Bill Erickson <berick@esilibrary.com>
LP#1234816: improve const-correctness of osrfCachePutString and osrfCachePutObject
Since the cache key is not modified by osrfCachePutString and
osrfCachePutObject, this patch changes the key parameter of those
two functions from char* to const char*. It also updates one
caller osrfCachePutObject to not cast away const-ness.
This patch has no functional impact, but enables future callers
of osrfCachePut* to pass constant strings without having to
cast away the const-ness.
Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Bill Erickson <berick@esilibrary.com>
This script is no longer user, since ejabberdctrl is used instead.
What's more, this script uses a Perl package (libnet-jabber-perl) which
is no longer available in Debian (Jessie).
Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Docgen output would be a bit more useful if it respected the formatting
(such as it is) of the signature content provided by the developer. So,
let's make that happen.
Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Instead of simply producing an error message in the OpenSRF logs, calls
to nonexistent subroutines are now fatal errors which will stop code
execution.
Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bill Erickson [Fri, 12 Oct 2012 20:57:15 +0000 (16:57 -0400)]
LP#1066131: srfsh.py should not require opensrf.settings
Update srfsh.py to connect to the opensrf network without automatically
reading the opensrf.setting server data. This allows srfsh.py to run a
non-private network.
Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bill Erickson [Tue, 7 Jan 2014 19:06:06 +0000 (14:06 -0500)]
osrf_control router-de/re-register and reload commands
Added support for the following new command line options:
--router-de-register
--router-de-register-all
Sends a SIGUSR1 signal to the selected service(s), which causes each
service's listener process to send an "unregister" command to all
registered routers. The --all variant sends the signal to all
running listeners. The non-(--all) variant requires a --service.
--router-re-register
--router-re-register-all
Sends a SIGUSR2 signal to the selected service(s), which causes each
service's listener process to send a "register" command to all
configured routers routers. The --all variant sends the signal to
all running listeners. The non-(--all) variant requires a --service.
--reload
--reload-all
Sends a SIGHUP signal to the selected service(s). SIGHUP causes
each Listener process to reload its opensrf_core.xml config file
and gracefully re-launch drone processes. The -all variant sends
the signal to all services. The non-(-all) variant requires a
--service.
Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bill Erickson [Tue, 7 Jan 2014 19:06:06 +0000 (14:06 -0500)]
osrf_control router-de/re-register and reload commands
Added support for the following new command line options:
--router-de-register
--router-de-register-all
Sends a SIGUSR1 signal to the selected service(s), which causes each
service's listener process to send an "unregister" command to all
registered routers. The --all variant sends the signal to all
running listeners. The non-(--all) variant requires a --service.
--router-re-register
--router-re-register-all
Sends a SIGUSR2 signal to the selected service(s), which causes each
service's listener process to send a "register" command to all
configured routers routers. The --all variant sends the signal to
all running listeners. The non-(--all) variant requires a --service.
--reload
--reload-all
Sends a SIGHUP signal to the selected service(s). SIGHUP causes
each Listener process to reload its opensrf_core.xml config file
and gracefully re-launch drone processes. The -all variant sends
the signal to all services. The non-(-all) variant requires a
--service.
Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bill Erickson [Thu, 21 Nov 2013 21:37:38 +0000 (16:37 -0500)]
recover osrf_control router start
With the addition of service verification, which ensures that a service
is meant to run on the requested host, we lost the ability to start the
router by itself, since the router is never explicitly configured to run
anywhere. This patch assumes the router is always a valid service.
Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Dan Wells <dbw2@calvin.edu>
Bill Erickson [Thu, 21 Nov 2013 21:37:38 +0000 (16:37 -0500)]
recover osrf_control router start
With the addition of service verification, which ensures that a service
is meant to run on the requested host, we lost the ability to start the
router by itself, since the router is never explicitly configured to run
anywhere. This patch assumes the router is always a valid service.
Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Dan Wells <dbw2@calvin.edu>
Bill Erickson [Thu, 5 Dec 2013 17:27:44 +0000 (12:27 -0500)]
OpenSRF client disconnect robustification (Perl)
* Improve detection of client connection state with jabber server
Be more aggressive in testing and responding to failed connectivity.
It can happen in various ways, depending on what's happening to the
jabber server (death, delay, graceful shutdown). With these changes
we attempt to cover all the bases and detect as early as possible that
a connection has died, specifically when trying to create a new
connection after one has failed.
* Do a better job of cleaning up dead connections
Transport::PeerHandle now has a reset() action which disconnects (when
possible) and clears the global connection reference.
Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bill Erickson [Thu, 5 Dec 2013 17:27:44 +0000 (12:27 -0500)]
OpenSRF client disconnect robustification (Perl)
* Improve detection of client connection state with jabber server
Be more aggressive in testing and responding to failed connectivity.
It can happen in various ways, depending on what's happening to the
jabber server (death, delay, graceful shutdown). With these changes
we attempt to cover all the bases and detect as early as possible that
a connection has died, specifically when trying to create a new
connection after one has failed.
* Do a better job of cleaning up dead connections
Transport::PeerHandle now has a reset() action which disconnects (when
possible) and clears the global connection reference.
Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Mike Rylander [Thu, 16 May 2013 14:17:15 +0000 (10:17 -0400)]
Protect subrequests from post-complete messages
Subrequests (AKA method_lookup()-based API calls) sometimes append
final-lvalue responses to the response list even after respond_complete()
has been called from within the implementation method. This commit
discards all post-respond_complete values, protecting against extra,
spurious values being returned to the ultimate client.
Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Mike Rylander [Thu, 16 May 2013 14:17:15 +0000 (10:17 -0400)]
Protect subrequests from post-complete messages
Subrequests (AKA method_lookup()-based API calls) sometimes append
final-lvalue responses to the response list even after respond_complete()
has been called from within the implementation method. This commit
discards all post-respond_complete values, protecting against extra,
spurious values being returned to the ultimate client.
Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
The patch for bug 1204123 changes the client_recv()
to not set the transport_client error flag, as most
of the circumstances where it would have been set were
for cases where the call to select() was interrupted
by a signal, which is not an error per se.
This patch removes two tests that were therefore
made invalid, restoring the ability of the test suite
to pass.
Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Bill Erickson <berick@esilibrary.com>
Any time a start action is issued (start, start_all, restart,
restart_all), osrf_control will first verify that the selected hostname
(or localhost) hosts the requested service(s). If not, the user is
warned and the script exits before any action is taken.
Note: we do not make a similar verification for stop and signal actions,
since those may be reasonably be used even when a service is not
configured to run on the selected host.
Thanks to Jason Stephenson for the suggestion.
Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Bill Erickson [Tue, 27 Aug 2013 15:47:52 +0000 (11:47 -0400)]
C SIGHUP handling and config reloading
Sending the HUP signal to a C Listener process now results in the
following:
* Reload the opensrf_core config
* update the log file level
* kill idle child processes
* child processes that are active when the signal is received are
tracked and killed once they become idle.
* New children are spawned per the min child settings
The primary use case for these changes is temporarily changing the log
level for a given service for debug purposes. It may also
be used, for example, to gracefully recover excess RAM consumed by a
child process.
opensrf.xml (opensrf.settings config) is not reloaded, so min/max child
settings will not be affected.
Signed-off-by: Bill Erickson <berick@esilibrary.com> Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>