client: detect if monkey-patched code changes
-
Owner
Hello @jm,
Recently with @Tyagov we were trying my wendelin.core tutorial[1] with NEO and when using it out of the box, i.e.
pip install wendelin.core neoppod
and thenroot = dbopen('neo://dbname@master')
neo.client.Storage tries to monkey-patch Connection.tpc_finish with first verifying Connection.tpc_finish code is in expected state and "fails":
>>> import neo.client Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/kirr/tmp/trashme/1/local/lib/python2.7/site-packages/neo/client/__ 'ab9b1b8d82c40e5fffa84f7bc4ea3a8b', # Python 2.7 File "/home/kirr/tmp/trashme/1/local/lib/python2.7/site-packages/neo/client/__ assert h in args, h AssertionError: b7b144f0a4865a272d4200e520193f1d
this happens e.g. with ZODB 4 in the following configuration:
(1) kirr@teco:~/tmp/trashme$ pip list BTrees (4.3.1) futures (3.0.5) neoppod (1.6.3) persistent (4.2.1) pip (8.1.2) pkg-resources (0.0.0) setuptools (24.0.3) six (1.10.0) transaction (1.6.1) trollius (2.1) wheel (0.29.0) zc.lockfile (1.2.1) ZConfig (3.1.0) zdaemon (4.1.0) ZEO (5.0.0a0) ZODB (4.4.2) ZODB3 (3.11.0) zodbpickle (0.6.0) zope.interface (4.2.0)
The monkey-patches there in
neo/client/__init__.py
are for "Allow serial to be returned as late as tpc_finish" and for Connection.afterCompletion not to call sync()I see our "Allow serial to be returned as late as tpc_finish" is already upstreamed:
https://github.com/zopefoundation/ZODB/commit/74fba08a
and is included in in ZODB >= 4.4.0
I also see many our patches are already upstreamed too. So my question here is:
- can we make this monkey-patching conditional and applied only to ZODB3 ?
- can we expect NEO to reasonably work with ZODB4 (and maybe 5) this way, or there are other blockers?
I ask because wendelin.core supports both ZODB3 and ZODB4 but for NEO current state is it works only on ZODB3 out-of-the-box.
Thanks beforehand,
Kirill -
Owner
See the 'next' branch: I have already started to work on this. I am also impatient to make ERP5 & NEO use more recent versions of ZODB (another blocker for this is erp5!112 (merged)).
I prefer to finish some development on ZODB5 (remove support of old commit protocol) before anything else.
software/neoppod/software-zodb4.cfg
is pinned to version 4.3.1. Can't you do the same for a while ? -
Owner
@jm thanks for feedback. I already saw the next branch and was just curious about current status. Btw it feels great that ZODB is being revived this days. If there were no ZODB3 / ZODB eggs split we could just limit neoppod to require ZODB <= 4.4.0dev, but with the split and current setuptools state such limiting is not possible.
Thus I've adjusted the tutorial to use ZODB 4.3.X
Good luck with ZODB5 and thanks again,
Kirill