Commit cc7d53ed authored by Vincent Pelletier's avatar Vincent Pelletier

Don't do the full lookup for tm when it could just be made local.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1695 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 941a99b8
...@@ -54,15 +54,16 @@ class StorageServiceHandler(BaseServiceHandler): ...@@ -54,15 +54,16 @@ class StorageServiceHandler(BaseServiceHandler):
def answerInformationLocked(self, conn, tid): def answerInformationLocked(self, conn, tid):
uuid = conn.getUUID() uuid = conn.getUUID()
app = self.app app = self.app
tm = app.tm
node = app.nm.getByUUID(uuid) node = app.nm.getByUUID(uuid)
# If the given transaction ID is later than the last TID, the peer # If the given transaction ID is later than the last TID, the peer
# is crazy. # is crazy.
if tid > self.app.tm.getLastTID(): if tid > tm.getLastTID():
raise ProtocolError('TID too big') raise ProtocolError('TID too big')
# transaction locked on this storage node # transaction locked on this storage node
t = self.app.tm[tid] t = tm[tid]
if not t.lock(uuid): if not t.lock(uuid):
return return
...@@ -90,7 +91,7 @@ class StorageServiceHandler(BaseServiceHandler): ...@@ -90,7 +91,7 @@ class StorageServiceHandler(BaseServiceHandler):
c.notify(Packets.NotifyUnlockInformation(tid)) c.notify(Packets.NotifyUnlockInformation(tid))
# remove transaction from manager # remove transaction from manager
self.app.tm.remove(tid) tm.remove(tid)
def notifyReplicationDone(self, conn, offset): def notifyReplicationDone(self, conn, offset):
uuid = conn.getUUID() uuid = conn.getUUID()
......
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