Closed dataflake closed 4 years ago
Thanks for the warning. cc @ale-rt for the changes in #143.
@dataflake can you write an example of buildout configuration that causes the failure?
Never mind, I think I got it:
fast-listen = 127.0.0.2:8120 127.0.0.1:8120
breaks the instance like:
File ".../plone/recipe/zope2instance/ctl.py", line 914, in server_factory
host, port = kws['fast-listen'].split(':')
ValueError: too many values to unpack (expected 2)
while
listen = 127.0.0.2:8120 127.0.0.1:8120
starts the server properly.
This is twice the same snippet, uh?
I tried with this patch:
[ale@emily plone.recipe.zope2instance]$ git diff -w
diff --git a/src/plone/recipe/zope2instance/ctl.py b/src/plone/recipe/zope2instance/ctl.py
index c6fd851..5441e71 100644
--- a/src/plone/recipe/zope2instance/ctl.py
+++ b/src/plone/recipe/zope2instance/ctl.py
@@ -911,7 +911,8 @@ def serve_paste(app, global_conf, **kw):
def server_factory(global_conf, **kws):
if 'fast-listen' in kws:
- host, port = kws['fast-listen'].split(':')
+ for host_port in kws['fast-listen'].split():
+ host, port = host_port.split(':')
prebound = dispatcher()
prebound.create_socket(socket.AF_INET, socket.SOCK_STREAM)
prebound.set_reuse_addr()
The instance starts but it actually listens only on the last host port combination.
I am inclined to revert #143 and update the documentation saying:
What do you think?
This is twice the same snippet, uh?
It was ;) Thanks for noticing
I am preparing a patch
It appears that the recipe will now translate the
http-address
specification from the buildout specification intofast-listen
in the WSGI initialization file where it used to writelisten
. This breaks all existing buildout configurations that specified multiple address/port combinations, which were acceptable for a WSGIlisten
statement, butfast-listen
cannot deal with it and the instance will not start. Serious party foul.