Commit 20b7cecd by Julien Muchembled

TODO: review election timeouts and transaction aborting on client disconnection

1 parent 79ea07c8
......@@ -203,6 +203,9 @@ class Application(BaseApplication):
# Wait until the connections are closed.
self.primary = None
self.primary_master_node = None
# XXX: Since poll does not wake up anymore every second,
# the following time condition should be reviewed.
# See also playSecondaryRole.
t = time() + 10
while self.em.getClientList() and time() < t:
try:
......@@ -356,6 +359,7 @@ class Application(BaseApplication):
# Wait for an announcement. If this is too long, probably
# the primary master is down.
# XXX: Same remark as in electPrimary.
t = time() + 10
while self.primary_master_node is None:
self.em.poll(1)
......
......@@ -378,6 +378,10 @@ class TransactionManager(object):
"""
Abort pending transactions initiated by a node
"""
# BUG: As soon as we have started to lock a transaction,
# we should complete it even if the client is lost.
# Of course, we won't reply to the FinishTransaction
# finish but we'll send invalidations to all clients.
logging.debug('Abort TXN for %s', node)
uuid = node.getUUID()
# XXX: this loop is usefull only during an import
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!