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
Levin Zimmermann
neoppod
Commits
0cc593ae
Commit
0cc593ae
authored
Mar 08, 2019
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: remove load lock in tpc_finish
parent
ef42ecc1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
7 deletions
+27
-7
neo/client/app.py
neo/client/app.py
+1
-6
neo/client/handlers/master.py
neo/client/handlers/master.py
+5
-1
neo/tests/threaded/test.py
neo/tests/threaded/test.py
+21
-0
No files found.
neo/client/app.py
View file @
0cc593ae
...
@@ -725,10 +725,7 @@ class Application(ThreadedApplication):
...
@@ -725,10 +725,7 @@ class Application(ThreadedApplication):
txn_container
=
self
.
_txn_container
txn_container
=
self
.
_txn_container
if
not
txn_container
.
get
(
transaction
).
voted
:
if
not
txn_container
.
get
(
transaction
).
voted
:
self
.
tpc_vote
(
transaction
)
self
.
tpc_vote
(
transaction
)
checked_list
=
[]
if
1
:
self
.
_load_lock_acquire
()
try
:
# Call finish on master
txn_context
=
txn_container
.
pop
(
transaction
)
txn_context
=
txn_container
.
pop
(
transaction
)
cache_dict
=
txn_context
.
cache_dict
cache_dict
=
txn_context
.
cache_dict
checked_list
=
[
oid
for
oid
,
data
in
cache_dict
.
iteritems
()
checked_list
=
[
oid
for
oid
,
data
in
cache_dict
.
iteritems
()
...
@@ -745,8 +742,6 @@ class Application(ThreadedApplication):
...
@@ -745,8 +742,6 @@ class Application(ThreadedApplication):
if
not
tid
:
if
not
tid
:
raise
raise
return
tid
return
tid
finally
:
self
.
_load_lock_release
()
def
_getFinalTID
(
self
,
ttid
):
def
_getFinalTID
(
self
,
ttid
):
try
:
try
:
...
...
neo/client/handlers/master.py
View file @
0cc593ae
...
@@ -82,9 +82,13 @@ class PrimaryNotificationsHandler(MTEventHandler):
...
@@ -82,9 +82,13 @@ class PrimaryNotificationsHandler(MTEventHandler):
cache
=
app
.
_cache
cache
=
app
.
_cache
app
.
_cache_lock_acquire
()
app
.
_cache_lock_acquire
()
try
:
try
:
invalidate
=
app
.
_cache
.
invalidate
loading
=
app
.
_loading_oid
for
oid
,
data
in
cache_dict
.
iteritems
():
for
oid
,
data
in
cache_dict
.
iteritems
():
# Update ex-latest value in cache
# Update ex-latest value in cache
cache
.
invalidate
(
oid
,
tid
)
invalidate
(
oid
,
tid
)
if
oid
==
loading
:
app
.
_loading_invalidated
.
append
(
tid
)
if
data
is
not
None
:
if
data
is
not
None
:
# Store in cache with no next_tid
# Store in cache with no next_tid
cache
.
store
(
oid
,
data
,
tid
,
None
)
cache
.
store
(
oid
,
data
,
tid
,
None
)
...
...
neo/tests/threaded/test.py
View file @
0cc593ae
...
@@ -862,6 +862,27 @@ class Test(NEOThreadedTest):
...
@@ -862,6 +862,27 @@ class Test(NEOThreadedTest):
self
.
assertEqual
(
c
.
root
()[
'1'
].
value
,
1
)
self
.
assertEqual
(
c
.
root
()[
'1'
].
value
,
1
)
self
.
assertNotIn
(
'2'
,
c
.
root
())
self
.
assertNotIn
(
'2'
,
c
.
root
())
@
with_cluster
()
def
testLoadVsFinish
(
self
,
cluster
):
t1
,
c1
=
cluster
.
getTransaction
()
c1
.
root
()[
'x'
]
=
x1
=
PCounter
()
t1
.
commit
()
t1
.
begin
()
x1
.
value
=
1
t2
,
c2
=
cluster
.
getTransaction
()
x2
=
c2
.
root
()[
'x'
]
cluster
.
client
.
_cache
.
clear
()
def
_loadFromStorage
(
orig
,
*
args
):
r
=
orig
(
*
args
)
ll
()
return
r
with
LockLock
()
as
ll
,
Patch
(
cluster
.
client
,
_loadFromStorage
=
_loadFromStorage
):
t
=
self
.
newThread
(
x2
.
_p_activate
)
ll
()
t1
.
commit
()
t
.
join
()
@
with_cluster
()
@
with_cluster
()
def
testInternalInvalidation
(
self
,
cluster
):
def
testInternalInvalidation
(
self
,
cluster
):
def
_handlePacket
(
orig
,
conn
,
packet
,
kw
=
{},
handler
=
None
):
def
_handlePacket
(
orig
,
conn
,
packet
,
kw
=
{},
handler
=
None
):
...
...
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