Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vincent Pelletier
neoppod
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
Show 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:
...
@@ -90,20 +90,20 @@ if 1:
Connection_open
=
Connection
.
open
Connection_open
=
Connection
.
open
Connection
.
open
=
open
Connection
.
open
=
open
# Storage.sync usually implements a "network barrier" (at least
# IStorage implementations usually need to provide a "network barrier",
# in NEO, but ZEO should be fixed to do the same), which is quite
# at least for NEO & ZEO, to make sure we have an up-to-date view of
# slow so we prefer to not call it where it's not useful.
# the storage. It's unclear whether sync() is a good place to do this
# I don't know any legitimate use of DB access outside a transaction.
# because a round-trip to the server introduces latency and we prefer
# it's not done when it's not useful.
# But old versions of ERP5 (before 2010-10-29 17:15:34) and maybe other
# For example, we know we are up-to-date after a successful commit,
# applications do not always call 'transaction.begin()' when they should
# so this should not be done in afterCompletion(), and anyway, we don't
# so this patch disabled as a precaution, at least as long as we support
# know any legitimate use of DB access outside a transaction.
# old software. This should also be discussed on zodb-dev ML first.
def
afterCompletion
(
self
,
*
ignored
):
def
afterCompletion
(
self
,
*
ignored
):
try
:
try
:
self
.
_readCurrent
.
clear
()
self
.
_readCurrent
.
clear
()
except
AttributeError
:
# BBB: ZODB < 3.10
except
AttributeError
:
# BBB: ZODB < 3.10
pass
pass
# PATCH: do not call sync()
self
.
_flush_invalidations
()
self
.
_flush_invalidations
()
#
Connection.afterCompletion = afterCompletion
Connection
.
afterCompletion
=
afterCompletion
neo/tests/threaded/__init__.py
View file @
b798fe8e
...
@@ -653,12 +653,7 @@ class NEOCluster(object):
...
@@ -653,12 +653,7 @@ class NEOCluster(object):
def
stop
(
self
):
def
stop
(
self
):
if
hasattr
(
self
,
'_db'
)
and
self
.
client
.
em
.
_timeout
==
0
:
if
hasattr
(
self
,
'_db'
)
and
self
.
client
.
em
.
_timeout
==
0
:
self
.
client
.
setPoll
(
True
)
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
()
self
.
__dict__
.
pop
(
'_db'
,
self
.
client
).
close
()
finally
:
Storage
.
Storage
.
sync
=
sync
try
:
try
:
Serialized
.
release
(
stop
=
Serialized
.
release
(
stop
=
self
.
admin_list
+
self
.
storage_list
+
self
.
master_list
)
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