diff --git a/neo/client/Storage.py b/neo/client/Storage.py index 099fec0c20273702f8465537a7b57e61cf2be8a1..bdf6394ce1bf6907c20c7cfb21d69e48a48a4cad 100644 --- a/neo/client/Storage.py +++ b/neo/client/Storage.py @@ -67,8 +67,6 @@ class Storage(BaseStorage.BaseStorage, 'deleteObject', 'undo', 'undoLog', - 'abortVersion', - 'commitVersion', ): setattr(self, method_id, raiseReadOnlyError) if _app is None: @@ -156,12 +154,6 @@ class Storage(BaseStorage.BaseStorage, def supportsTransactionalUndo(self): return True - def abortVersion(self, src, transaction): - return self.app.abortVersion(src, transaction) - - def commitVersion(self, src, dest, transaction): - return self.app.commitVersion(src, dest, transaction) - def loadEx(self, oid, version): try: data, serial, _ = self.app.load(oid) diff --git a/neo/client/app.py b/neo/client/app.py index 0be868f073be831c90aafc38fd7fdc2615e3c2be..4f7ee3ae39292dbf9d425923517e12f00ea96d5d 100644 --- a/neo/client/app.py +++ b/neo/client/app.py @@ -465,7 +465,6 @@ class Application(object): if answer_ttid is None: raise NEOStorageError('tpc_begin failed') assert tid in (None, answer_ttid), (tid, answer_ttid) - txn_context['txn'] = transaction txn_context['ttid'] = answer_ttid def store(self, oid, serial, data, version, transaction): @@ -475,7 +474,6 @@ class Application(object): raise StorageTransactionError(self, transaction) logging.debug('storing oid %s serial %s', dump(oid), dump(serial)) self._store(txn_context, oid, serial, data) - return None def _store(self, txn_context, oid, serial, data, data_serial=None, unlock=False): @@ -984,16 +982,6 @@ class Application(object): self._askPrimary(Packets.AskLastTransaction()) return self.last_tid - def abortVersion(self, src, transaction): - if self._txn_container.get(transaction) is None: - raise StorageTransactionError(self, transaction) - return '', [] - - def commitVersion(self, src, dest, transaction): - if self._txn_container.get(transaction) is None: - raise StorageTransactionError(self, transaction) - return '', [] - def __del__(self): """Clear all connection.""" # Due to bug in ZODB, close is not always called when shutting diff --git a/neo/client/pool.py b/neo/client/pool.py index 1023d1d3e8409911f04175ad36f8b078d297c152..d88dd1ff908eeabbd0d1f168d4ced148ea5d3da9 100644 --- a/neo/client/pool.py +++ b/neo/client/pool.py @@ -114,7 +114,7 @@ class ConnectionPool(object): if not cell_list: raise NEOStorageError('no storage available') getConnForNode = self.getConnForNode - while cell_list: + while 1: new_cell_list = [] # Shuffle to randomise node to access... shuffle(cell_list) @@ -131,10 +131,11 @@ class ConnectionPool(object): # state can have changed during connection attempt. elif node.isRunning(): new_cell_list.append(cell) + if not new_cell_list: + break cell_list = new_cell_list - if new_cell_list: - # wait a bit to avoid a busy loop - time.sleep(1) + # wait a bit to avoid a busy loop + time.sleep(1) def getConnForNode(self, node): """Return a locked connection object to a given node