LP#1729610: extend backlog queue to C apps
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 12 Dec 2018 19:35:56 +0000 (14:35 -0500)
committerMike Rylander <mrylander@gmail.com>
Fri, 4 Jan 2019 19:06:37 +0000 (14:06 -0500)
commitd7e9df6838f1c9a72db3fd41556d178cfe7f6700
tree6122922e82c2161b6049ea56abc21932353e5190
parentefa9b713d5341458a3afaa26d1cf9e750fa78654
LP#1729610: extend backlog queue to C apps

This patch extends the notion of a backlog queue to C apps and
offers the same functionality as the Perl side of the patch series:

- max_backlog_queue configuration setting
- ability to queue messages up to the configured limit
- ability to drop requests that would overflow the backlog
  queue and send status 503 exceptions back to the client.

This patch also adds a new service, opensrf.cslow, that implements
a opensrf.cslow.wait method similar to the Perl opensrf.slooooooow
service.

To test
-------
[1] Set a low max_backlog_queue for opensrf.cslow and a low
    max_children.
[2] Arrange for srfsh to fire off a bunch of opensrf.cslow.wait
    requests.
[3] Verify that requests that come in after the backlog queue fills
    up immediately get 503 exceptions.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
examples/opensrf.xml.example
src/c-apps/Makefile.am
src/c-apps/osrf_cslow.c [new file with mode: 0644]
src/libopensrf/osrf_prefork.c