Patches: Chained Selectors and Multiple Listen

Jeremy James jbj at forbidden.co.uk
Wed Apr 25 16:26:05 UTC 2007


Ok,

A couple of patches against the svn repos are attached adding two bits
of functionality to perlbal.

The first allows multiple selectors to be 'chained' together - it deals
with the same bit of code that Matt Mankins' patch (last December) did,
but handles things in a slightly different way as required by selectors.
A modified version of 31-realworld.t does an extra loop, putting all
requests through two selectors before hitting the reverse_proxy.


The second patch allows multiple IP addresses to be specified to listen
on, separated by commas. It creates an array of TCPListener objects
inside Service, and closes each one individually when a service is
disabled. We ignore UploadListener objects for now - they are only
allowed one listen address (although obviously this raises some sort of
inconsistency against the documentation).

There's a question of behaviour with multiple IPs - should perlbal fall
over if it cannot aquire all addresses, or should it try as many as it
can? This version will run if it can acquire any of the given listen
addresses (and only fail if it cannot acquire all of them).

There's another patch to 31-realworld.t (which will conflict with the
one above) that establishes a new service with two listening addresses,
and tests both of them. Obviously, these tests should probably be
elsewhere, with checks to make sure that IP addresses are handled
properly (correct formatting wrt commas and the like).


Brad - do these patches look useful for general consumption? They
work_for_us (TM), but not having had weeks of testing may behave badly
in the face of high traffic with large PUTs and the like, and you
probably have a better idea if they will cause problems somewhere else.

Many thanks,
Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: perlbal-service-chained-selectors-withtest.patch
Type: text/x-patch
Size: 1842 bytes
Desc: not available
Url : http://lists.danga.com/pipermail/perlbal/attachments/20070425/0acfe1b0/perlbal-service-chained-selectors-withtest.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: perlbal-service-multiplelisten-withtest.patch
Type: text/x-patch
Size: 4389 bytes
Desc: not available
Url : http://lists.danga.com/pipermail/perlbal/attachments/20070425/0acfe1b0/perlbal-service-multiplelisten-withtest.bin


More information about the perlbal mailing list