From 7207ad53fed5a54a76514eb2365595db537b334f Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 7 Dec 2020 11:58:41 +0000 Subject: [PATCH] Comments --- federationsender/queue/destinationqueue.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/federationsender/queue/destinationqueue.go b/federationsender/queue/destinationqueue.go index 23b3452b8..a67dd06ae 100644 --- a/federationsender/queue/destinationqueue.go +++ b/federationsender/queue/destinationqueue.go @@ -56,8 +56,8 @@ type destinationQueue struct { overflowed atomic.Bool // the queues exceed maxPDUsInMemory/maxEDUsInMemory, so we should consult the database for more statistics *statistics.ServerStatistics // statistics about this remote server transactionIDMutex sync.Mutex // protects transactionID - transactionID gomatrixserverlib.TransactionID // last transaction ID - notify chan struct{} // interrupts idle wait for overflowed PDUs/EDUs from the database + transactionID gomatrixserverlib.TransactionID // last transaction ID if retrying, or "" if last txn was successful + notify chan struct{} // interrupts idle wait pending PDUs/EDUs pendingPDUs []*queuedPDU // PDUs waiting to be sent pendingEDUs []*queuedEDU // EDUs waiting to be sent pendingMutex sync.RWMutex // protects pendingPDUs and pendingEDUs @@ -269,6 +269,7 @@ func (oq *destinationQueue) backgroundSend() { } } + // Work out which PDUs/EDUs to include in the next transaction. oq.pendingMutex.RLock() pduCount := len(oq.pendingPDUs) eduCount := len(oq.pendingEDUs)