Commit aeda6d88 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Partial revert of the previous commit. A dead lock was introduced instead of

fix a potential bug. The ptid attribute on app is still removed.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1079 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 9e4f6725
##
#
# Copyright (C) 2006-2009 Nexedi SA
#
# This program is free software; you can redistribute it and/or
......@@ -389,7 +389,7 @@ class Application(object):
finally:
self._connecting_to_master_node_release()
def getPartitionTable(self):
def _getPartitionTable(self):
""" Return the partition table manager, reconnect the PMN if needed """
# this ensure the master connection is established and the partition
# table is up to date.
......@@ -398,12 +398,12 @@ class Application(object):
def _getCellListForOID(self, oid, readable=False, writable=False):
""" Return the cells available for the specified OID """
pt = self.getPartitionTable()
pt = self._getPartitionTable()
return pt.getCellListForOID(oid, readable, writable)
def _getCellListForTID(self, tid, readable=False, writable=False):
""" Return the cells available for the specified TID """
pt = self.getPartitionTable()
pt = self._getPartitionTable()
return pt.getCellListForTID(tid, readable, writable)
def _connectToPrimaryMasterNode(self):
......@@ -731,7 +731,7 @@ class Application(object):
ext = dumps(transaction._extension)
oid_list = self.local_var.data_dict.keys()
# Store data on each node
pt = self.getPartitionTable()
pt = self._getPartitionTable()
cell_list = self._getCellListForTID(self.local_var.tid, writable=True)
self.local_var.voted_counter = 0
for cell in cell_list:
......@@ -889,7 +889,7 @@ class Application(object):
# First get a list of transactions from all storage nodes.
# Each storage node will return TIDs only for UP_TO_DATE_STATE and
# FEEDING_STATE cells
pt = self.getPartitionTable()
pt = self._getPartitionTable()
storage_node_list = pt.getNodeList()
self.local_var.node_tids = {}
......
......@@ -150,13 +150,15 @@ class PrimaryNotificationsHandler(BaseHandler):
finally:
app._cache_lock_release()
# For the two methods below, we must not use app._getPartitionTable()
# to avoid a dead lock. It is safe to not check the master connection
# because it's in the master handler, so the connection is already
# established.
def handleNotifyPartitionChanges(self, conn, packet, ptid, cell_list):
pt = self.app.getPartitionTable()
pt.update(ptid, cell_list, self.app.nm)
self.app.pt.update(ptid, cell_list, self.app.nm)
def handleSendPartitionTable(self, conn, packet, ptid, row_list):
pt = self.app.getPartitionTable()
pt.load(ptid, row_list, self.app.nm)
self.app.pt.load(ptid, row_list, self.app.nm)
def handleNotifyNodeInformation(self, conn, packet, node_list):
app = self.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