Don't rearrange transaction_queue

This commit is contained in:
Erik Johnston 2015-11-03 16:31:08 +00:00
parent 7ce264ce5f
commit 97d792b28f

View File

@ -203,6 +203,17 @@ class TransactionQueue(object):
@log_function
def _attempt_new_transaction(self, destination):
# list of (pending_pdu, deferred, order)
if destination in self.pending_transactions:
# XXX: pending_transactions can get stuck on by a never-ending
# request at which point pending_pdus_by_dest just keeps growing.
# we need application-layer timeouts of some flavour of these
# requests
logger.debug(
"TX [%s] Transaction already in progress",
destination
)
return
pending_pdus = self.pending_pdus_by_dest.pop(destination, [])
pending_edus = self.pending_edus_by_dest.pop(destination, [])
pending_failures = self.pending_failures_by_dest.pop(destination, [])
@ -215,18 +226,6 @@ class TransactionQueue(object):
logger.debug("TX [%s] Nothing to send", destination)
return
if destination in self.pending_transactions:
# XXX: pending_transactions can get stuck on by a never-ending
# request at which point pending_pdus_by_dest just keeps growing.
# we need application-layer timeouts of some flavour of these
# requests
logger.debug(
"TX [%s] Transaction already in progress",
destination
)
return
# NOTE: Nothing should be between the above check and the insertion below
try:
self.pending_transactions[destination] = 1