Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
b798fe8e
Commit
b798fe8e
authored
Jul 23, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: enable patch to avoid useless ping to master at end of transactions
parent
c277ed20
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
22 deletions
+17
-22
neo/client/__init__.py
neo/client/__init__.py
+16
-16
neo/tests/threaded/__init__.py
neo/tests/threaded/__init__.py
+1
-6
No files found.
neo/client/__init__.py
View file @
b798fe8e
...
...
@@ -90,20 +90,20 @@ if 1:
Connection_open
=
Connection
.
open
Connection
.
open
=
open
# Storage.sync usually implements a "network barrier" (at least
# in NEO, but ZEO should be fixed to do the same), which is quite
# slow so we prefer to not call it where it's not useful.
# I don't know any legitimate use of DB access outside a transaction.
# IStorage implementations usually need to provide a "network barrier",
# at least for NEO & ZEO, to make sure we have an up-to-date view of
# the storage. It's unclear whether sync() is a good place to do this
# because a round-trip to the server introduces latency and we prefer
# it's not done when it's not useful.
# For example, we know we are up-to-date after a successful commit,
# so this should not be done in afterCompletion(), and anyway, we don't
# know any legitimate use of DB access outside a transaction.
# But old versions of ERP5 (before 2010-10-29 17:15:34) and maybe other
# applications do not always call 'transaction.begin()' when they should
# so this patch disabled as a precaution, at least as long as we support
# old software. This should also be discussed on zodb-dev ML first.
def
afterCompletion
(
self
,
*
ignored
):
try
:
self
.
_readCurrent
.
clear
()
except
AttributeError
:
# BBB: ZODB < 3.10
pass
self
.
_flush_invalidations
()
#Connection.afterCompletion = afterCompletion
def
afterCompletion
(
self
,
*
ignored
):
try
:
self
.
_readCurrent
.
clear
()
except
AttributeError
:
# BBB: ZODB < 3.10
pass
# PATCH: do not call sync()
self
.
_flush_invalidations
()
Connection
.
afterCompletion
=
afterCompletion
neo/tests/threaded/__init__.py
View file @
b798fe8e
...
...
@@ -653,12 +653,7 @@ class NEOCluster(object):
def
stop
(
self
):
if
hasattr
(
self
,
'_db'
)
and
self
.
client
.
em
.
_timeout
==
0
:
self
.
client
.
setPoll
(
True
)
sync
=
Storage
.
Storage
.
sync
.
im_func
Storage
.
Storage
.
sync
=
lambda
self
,
force
=
True
:
None
try
:
self
.
__dict__
.
pop
(
'_db'
,
self
.
client
).
close
()
finally
:
Storage
.
Storage
.
sync
=
sync
self
.
__dict__
.
pop
(
'_db'
,
self
.
client
).
close
()
try
:
Serialized
.
release
(
stop
=
self
.
admin_list
+
self
.
storage_list
+
self
.
master_list
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment