Commit 56795631 authored by Kirill Smelkov's avatar Kirill Smelkov

ZEO: Factor it to separate component

We already patch ZEO4 with TCP_NODELAY patch (see 5cf4cf1f "ERP5:
enable TCP_NODELAY for ZEO") and we will need to backport more patches
to ZEO4 branch for wendelin.core 2 to work correctly.

It's not only software/neoppod which uses ZEO, and it is not convenient for
all other software-releases to inherit from neoppod to use correct
version and build of ZEO egg. For this reason factor out details of ZEO
egg building into component/ZEO and let users use ${ZEO:egg} where ZEO
is needed. This way ZEO will be correctly installed for all users.

This patch should be a non-functional change. We switch to
nexedi/ZEO@5114f909 revision which corresponds to ZEO 4.3.1 +
TCP_NODELAY.patch

Adding other patches to ZEO4 needed by wendelin.core 2 will be done as a
separate step.
parent 34ebf8b5
# SlapOS component for ZEO.
# https://zeo.readthedocs.io/
[buildout]
extends =
../git/buildout.cfg
parts = ZEO/scripts
# ZEO allows to use either ZEO4 or ZEO5
# To select which version to use users should do:
#
# [ZEO]
# egg = ${ZEO<version>:egg}
#
# By default ZEO4 is used.
[ZEO]
recipe = zc.recipe.egg:eggs
egg = ${ZEO4:egg}
eggs = ${:egg}
# ZEO/scripts installs scripts from ZEO
[ZEO/scripts]
recipe = zc.recipe.egg:scripts
eggs = ${ZEO:egg}
# ZEO4: we maintain our own 4-nxd branch with patches
[ZEO4]
recipe = zc.recipe.egg:develop
setup = ${ZEO4-repository:location}
egg = ZEO
[ZEO4-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/ZEO.git
branch = 4-nxd
revision= 5114f909e5a5
location = ${buildout:parts-directory}/ZEO4
git-executable = ${git:location}/bin/git
# ZEO5 is plain upstream egg
[ZEO5]
recipe = zc.recipe.egg:eggs
egg = ZEO
eggs = ${:egg}
[versions]
# Required by:
# ZEO==4.3.1
zdaemon = 4.2.0
From 8b31ccec54584a287cc61501948283d7d6ee7073 Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Mon, 26 Mar 2018 20:39:07 +0200
Subject: [PATCH] Enable TCP_NODELAY for inet(6) sockets
See commit 3d886d426243655b9f5a2528636e42b5c7662c19.
---
src/ZEO/zrpc/client.py | 2 ++
src/ZEO/zrpc/server.py | 1 +
2 files changed, 3 insertions(+)
diff --git a/src/ZEO/zrpc/client.py b/src/ZEO/zrpc/client.py
index 32a7a877..669f5962 100644
--- a/src/ZEO/zrpc/client.py
+++ b/src/ZEO/zrpc/client.py
@@ -568,6 +568,8 @@ def __init__(self, domain, addr, mgr, client):
self.close()
return
self.sock.setblocking(0)
+ if domain in (socket.AF_INET, socket.AF_INET6):
+ self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
self.state = "opened"
def connect_procedure(self):
diff --git a/src/ZEO/zrpc/server.py b/src/ZEO/zrpc/server.py
index b83cc004..af91e3e4 100644
--- a/src/ZEO/zrpc/server.py
+++ b/src/ZEO/zrpc/server.py
@@ -66,6 +66,7 @@ def _open_socket(self):
socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, True)
else:
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
else:
self.create_socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.set_reuse_addr()
--
2.14.1
......@@ -15,10 +15,10 @@ extends =
../../component/lxml-python/buildout.cfg
#END LXML
../../component/msgpack-python/buildout.cfg
../../component/patch/buildout.cfg
../../component/python-mysqlclient/buildout.cfg
../../component/python-cryptography/buildout.cfg
../../component/pycurl/buildout.cfg
../../component/ZEO/buildout.cfg
parts =
# keep neoppod first so that ZODB is built correctly,
......@@ -54,10 +54,7 @@ eggs = neoppod[admin, ctl, master]
coverage
setproctitle
adapter-egg = ${python-mysqlclient:egg}
patch-binary = ${patch:location}/bin/patch
ZEO-patch-options = -p1
ZEO-patches =
${:_profile_base_location_}/../../component/egg-patch/ZEO4/TCP_NODELAY.patch#b07288522d5c6857738240d948321df6
depends = ${ZEO:egg}
# XXX: buildout fails to install properly eggs with setup_requires
[BTrees]
......@@ -160,15 +157,6 @@ python-dateutil = 2.7.3
# zodbtools==0.0.0dev4
zodburi = 2.3.0
# Required by:
# zodburi==2.0
# ZEO 5 requires transaction >= 2
ZEO = 4.3.1+SlapOSPatched001
# Required by:
# ZEO==4.3.1
zdaemon = 4.2.0
# Required by:
# mock = 3.0.5
funcsigs = 1.0.2
......@@ -3,7 +3,9 @@ extends = software.cfg
[neoppod]
eggs += mock
ZEO-patches =
[ZEO]
egg = ${ZEO5:egg}
[versions]
ZODB = 5.6.0
......
......@@ -103,7 +103,7 @@ eggs =
# to install not only wendelin.core modules but also scripts
wendelin.core
# for ZEO scripts (runzeo)
ZEO
${ZEO:egg}
# for nxd/runTestSuite
erp5.util
# for e.g. tcpu.py
......
......@@ -455,7 +455,7 @@ eggs = ${neoppod:eggs}
# Zope acquisition patch
Acquisition
# for runzeo
ZEO
${ZEO:egg}
# Other Zope 2 packages
Products.PluggableAuthService
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment