Server hammered with history requests
I noticed in nethogs that Gajim is using a lot of bandwidth. After some looking around I discovered it keeps querying the server for past messages - even though it's been running for hours and there isn't that much to sync.
A short sample of stanzas it keeps sending to the server is here: http://pastebin.com/BbYJMg28 - sorry, Trac said my sample had "too many links" so I could not post it here.
Steps to reproduce
OS version: Ubuntu 14.04
GTK+ Version: 2.24.23 PyGTK Version: 2.24.0
Openfire: 3.9.3 and 3.10.2 (performed an upgrade when checking this issue)
The message triggering this behavior is:
\<message xmlns="jabber:client">\<fin xmlns="urn:xmpp:mam:0" queryid="2995" complete="true">\<set xmlns="http://jabber.org/protocol/rsm">\<first index="168">1191\</first>\<last>1211\</last>\<count>187\</count>\</set>\</fin>\</message>
It's always the same, the only thing that changes is queryid.
I've experimentally patched Gajim to stop this behavior, I'm not sure if i didn't break some part of XEP313, but at least it stopped hammering the server:
diff --git a/common/message_archiving.py b/common/message_archiving.py index 630f452..90f1964 100644 --- a/common/message_archiving.py +++ b/common/message_archiving.py @@ -100,9 +100,11 @@ class ConnectionArchive313(ConnectionArchive): if self.awaiting_answers[queryid_] == MAM_RESULTS_ARRIVED: set_ = fin_.getTag('set', namespace=nbxmpp.NS_RSM) if set_: + complete = fin_.getAttr('complete') last = set_.getTagData('last') - if last: + if last and complete \<> 'true': gajim.config.set_per('accounts', self.name, 'last_mam_id', last) + print obj.stanza self.request_archive(after=last) del self.awaiting_answers[queryid_]
your logs are a bit strange, there are only outgoing stanza. But you're right that we should look at complete attribute.