Commit 20b7cecd authored by Julien Muchembled's avatar Julien Muchembled

TODO: review election timeouts and transaction aborting on client disconnection

parent 79ea07c8
...@@ -203,6 +203,9 @@ class Application(BaseApplication): ...@@ -203,6 +203,9 @@ class Application(BaseApplication):
# Wait until the connections are closed. # Wait until the connections are closed.
self.primary = None self.primary = None
self.primary_master_node = 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 t = time() + 10
while self.em.getClientList() and time() < t: while self.em.getClientList() and time() < t:
try: try:
...@@ -356,6 +359,7 @@ class Application(BaseApplication): ...@@ -356,6 +359,7 @@ class Application(BaseApplication):
# Wait for an announcement. If this is too long, probably # Wait for an announcement. If this is too long, probably
# the primary master is down. # the primary master is down.
# XXX: Same remark as in electPrimary.
t = time() + 10 t = time() + 10
while self.primary_master_node is None: while self.primary_master_node is None:
self.em.poll(1) self.em.poll(1)
......
...@@ -378,6 +378,10 @@ class TransactionManager(object): ...@@ -378,6 +378,10 @@ class TransactionManager(object):
""" """
Abort pending transactions initiated by a node 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) logging.debug('Abort TXN for %s', node)
uuid = node.getUUID() uuid = node.getUUID()
# XXX: this loop is usefull only during an import # XXX: this loop is usefull only during an import
......
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