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
Xavier Thompson
neoppod
Commits
0e133ebb
Commit
0e133ebb
authored
Jan 02, 2017
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: do not loop forever if conflicts happen on a big amount of data
parent
aeb8549b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
neo/client/app.py
neo/client/app.py
+3
-0
neo/client/handlers/storage.py
neo/client/handlers/storage.py
+4
-0
neo/tests/threaded/test.py
neo/tests/threaded/test.py
+17
-0
No files found.
neo/client/app.py
View file @
0e133ebb
...
@@ -455,6 +455,9 @@ class Application(ThreadedApplication):
...
@@ -455,6 +455,9 @@ class Application(ThreadedApplication):
while
txn_context
[
'data_size'
]
>=
self
.
_cache
.
_max_size
:
while
txn_context
[
'data_size'
]
>=
self
.
_cache
.
_max_size
:
self
.
_waitAnyTransactionMessage
(
txn_context
)
self
.
_waitAnyTransactionMessage
(
txn_context
)
# Do not loop forever if conflicts happen on a big amount of data.
if
not
self
.
dispatcher
.
pending
(
queue
):
return
self
.
_waitAnyTransactionMessage
(
txn_context
,
False
)
self
.
_waitAnyTransactionMessage
(
txn_context
,
False
)
def
_handleConflicts
(
self
,
txn_context
,
tryToResolveConflict
):
def
_handleConflicts
(
self
,
txn_context
,
tryToResolveConflict
):
...
...
neo/client/handlers/storage.py
View file @
0e133ebb
...
@@ -66,6 +66,10 @@ class StorageAnswersHandler(AnswerBaseHandler):
...
@@ -66,6 +66,10 @@ class StorageAnswersHandler(AnswerBaseHandler):
object_stored_counter_dict
=
txn_context
[
object_stored_counter_dict
=
txn_context
[
'object_stored_counter_dict'
][
oid
]
'object_stored_counter_dict'
][
oid
]
if
conflict
:
if
conflict
:
# Conflicts can not be resolved now because 'conn' is locked.
# We must postpone the resolution (by queuing the conflict in
# 'conflict_dict') to avoid any deadlock with another thread that
# also resolves a conflict successfully to the same storage nodes.
# Warning: if a storage (S1) is much faster than another (S2), then
# Warning: if a storage (S1) is much faster than another (S2), then
# we may process entirely a conflict with S1 (i.e. we received the
# we may process entirely a conflict with S1 (i.e. we received the
# answer to the store of the resolved object on S1) before we
# answer to the store of the resolved object on S1) before we
...
...
neo/tests/threaded/test.py
View file @
0e133ebb
...
@@ -1362,5 +1362,22 @@ class Test(NEOThreadedTest):
...
@@ -1362,5 +1362,22 @@ class Test(NEOThreadedTest):
ll
()
ll
()
t
.
join
()
t
.
join
()
@
with_cluster
()
def
testSameNewOidAndConflictOnBigValue
(
self
,
cluster
):
storage
=
cluster
.
getZODBStorage
()
oid
=
storage
.
new_oid
()
txn
=
transaction
.
Transaction
()
storage
.
tpc_begin
(
txn
)
storage
.
store
(
oid
,
None
,
'foo'
,
''
,
txn
)
storage
.
tpc_vote
(
txn
)
storage
.
tpc_finish
(
txn
)
txn
=
transaction
.
Transaction
()
storage
.
tpc_begin
(
txn
)
storage
.
store
(
oid
,
None
,
'*'
*
storage
.
_cache
.
_max_size
,
''
,
txn
)
self
.
assertRaises
(
POSException
.
ConflictError
,
storage
.
tpc_vote
,
txn
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
main
()
unittest
.
main
()
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