LP#1729610: extend backlog queue to C apps user/berick/lp1729610-request-queueing-signoff
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 12 Dec 2018 19:35:56 +0000 (14:35 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 27 Dec 2018 15:35:39 +0000 (10:35 -0500)
commit236d4b7dbb9b838c9e9e82eb33d866e9fa3049f0
tree6122922e82c2161b6049ea56abc21932353e5190
parent53b35d28b40fc9f0a3cf956c0d0fa7933a99e787
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>
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