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
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
7aecdada
Commit
7aecdada
authored
Mar 21, 2016
by
Julien Muchembled
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: fix crash when a client disconnects just after it requested to finish a transaction
parent
b05b961b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
neo/storage/transactions.py
neo/storage/transactions.py
+9
-2
No files found.
neo/storage/transactions.py
View file @
7aecdada
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
from
time
import
time
from
time
import
time
from
neo.lib
import
logging
from
neo.lib
import
logging
from
neo.lib.util
import
dump
from
neo.lib.util
import
dump
from
neo.lib.protocol
import
uuid_str
,
ZERO_TID
from
neo.lib.protocol
import
ProtocolError
,
uuid_str
,
ZERO_TID
class
ConflictError
(
Exception
):
class
ConflictError
(
Exception
):
"""
"""
...
@@ -183,7 +183,10 @@ class TransactionManager(object):
...
@@ -183,7 +183,10 @@ class TransactionManager(object):
Lock a transaction
Lock a transaction
"""
"""
logging
.
debug
(
'Lock TXN %s (ttid=%s)'
,
dump
(
tid
),
dump
(
ttid
))
logging
.
debug
(
'Lock TXN %s (ttid=%s)'
,
dump
(
tid
),
dump
(
ttid
))
try
:
transaction
=
self
.
_transaction_dict
[
ttid
]
transaction
=
self
.
_transaction_dict
[
ttid
]
except
KeyError
:
raise
ProtocolError
(
"unknown ttid %s"
%
dump
(
ttid
))
# remember that the transaction has been locked
# remember that the transaction has been locked
transaction
.
lock
()
transaction
.
lock
()
self
.
_load_lock_dict
.
update
(
self
.
_load_lock_dict
.
update
(
...
@@ -339,6 +342,10 @@ class TransactionManager(object):
...
@@ -339,6 +342,10 @@ class TransactionManager(object):
Abort any non-locked transaction of a node
Abort any non-locked transaction of a node
"""
"""
logging
.
debug
(
'Abort for %s'
,
uuid_str
(
uuid
))
logging
.
debug
(
'Abort for %s'
,
uuid_str
(
uuid
))
# BUG: Discarding voted transactions must only be a decision of the
# master, and for this, we'll need to review how transactions are
# aborted. As a workaround, we rely on the fact that lock() will
# disconnect from the master in case of LockInformation.
# abort any non-locked transaction of this node
# abort any non-locked transaction of this node
for
ttid
in
[
x
.
getTTID
()
for
x
in
self
.
_uuid_dict
.
get
(
uuid
,
[])]:
for
ttid
in
[
x
.
getTTID
()
for
x
in
self
.
_uuid_dict
.
get
(
uuid
,
[])]:
self
.
abort
(
ttid
)
self
.
abort
(
ttid
)
...
...
Julien Muchembled
@jm
mentioned in commit
2d388048
·
Aug 01, 2016
mentioned in commit
2d388048
mentioned in commit 2d3880482794659d68ca5f54294e794d78965f7b
Toggle commit list
Julien Muchembled
@jm
mentioned in commit
15472c62
·
Nov 28, 2016
mentioned in commit
15472c62
mentioned in commit 15472c623151fe0d6951c56f72635579118b0073
Toggle commit 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