Commit 1551c4a9 authored by Julien Muchembled's avatar Julien Muchembled

comments, unused import

parent ce42103a
...@@ -30,6 +30,7 @@ from ..exception import NEOStorageReadRetry, NEOStorageDoesNotExistError ...@@ -30,6 +30,7 @@ from ..exception import NEOStorageReadRetry, NEOStorageDoesNotExistError
class StorageEventHandler(MTEventHandler): class StorageEventHandler(MTEventHandler):
def connectionLost(self, conn, new_state): def connectionLost(self, conn, new_state):
# TODO: refactor with connectionFailed
node = self.app.nm.getByAddress(conn.getAddress()) node = self.app.nm.getByAddress(conn.getAddress())
assert node is not None assert node is not None
self.app.cp.removeConnection(node) self.app.cp.removeConnection(node)
......
...@@ -91,7 +91,7 @@ class Transaction(object): ...@@ -91,7 +91,7 @@ class Transaction(object):
'no storage available for write to partition %s' % object_id) 'no storage available for write to partition %s' % object_id)
def written(self, app, uuid, oid): def written(self, app, uuid, oid):
# When a node that is being disconnected by the master because it was # When a node is being disconnected by the master because it was
# not part of the transaction that caused a conflict, we may receive a # not part of the transaction that caused a conflict, we may receive a
# positive answer (not to be confused with lockless stores) before the # positive answer (not to be confused with lockless stores) before the
# conflict. Because we have no way to identify such case, we must keep # conflict. Because we have no way to identify such case, we must keep
......
...@@ -152,9 +152,9 @@ class TransactionManager(EventQueue): ...@@ -152,9 +152,9 @@ class TransactionManager(EventQueue):
store_lock_dict = self._store_lock_dict store_lock_dict = self._store_lock_dict
replicated = self._replicated replicated = self._replicated
notify = {x[0] for x in replicated.iteritems() if x[1]} notify = {x[0] for x in replicated.iteritems() if x[1]}
# We sort transactions so that in case of muliple stores/checks for the # We sort transactions so that in case of multiple stores/checks
# same oid, the lock is taken by the highest locking ttid, which will # for the same oid, the lock is taken by the highest locking ttid,
# delay new transactions. # which will delay new transactions.
for txn, ttid in sorted((txn, ttid) for ttid, txn in for txn, ttid in sorted((txn, ttid) for ttid, txn in
self._transaction_dict.iteritems()): self._transaction_dict.iteritems()):
if txn.locking_tid == MAX_TID: if txn.locking_tid == MAX_TID:
......
...@@ -23,7 +23,6 @@ from contextlib import contextmanager ...@@ -23,7 +23,6 @@ from contextlib import contextmanager
from itertools import count from itertools import count
from functools import partial, wraps from functools import partial, wraps
from zlib import decompress from zlib import decompress
from ..mock import Mock
import transaction, ZODB import transaction, ZODB
import neo.admin.app, neo.master.app, neo.storage.app import neo.admin.app, neo.master.app, neo.storage.app
import neo.client.app, neo.neoctl.app import neo.client.app, neo.neoctl.app
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment