LP#1729610: extend backlog queue to C apps user/gmcharlt/lp1729610_request_queuing_mark2
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 12 Dec 2018 19:35:56 +0000 (14:35 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 18 Dec 2018 12:46:52 +0000 (07:46 -0500)
commitb1010163c85a3574f4c43b4e97ad8e652676706b
tree9b083198849ca6e054aa8300499f833461d9a35f
parente4c4b5585f5dd9b5e97112555546a781a0c7505c
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>
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