Pubsub - flood of subscription events

Hi all,

I’ve been using XMPP/Openfire (currently 3.8.1) for a while now on the server side via node.js and on the client side via Strophe. So, I utilize a BOSH server (node-xmpp-bosh) as the conduit from the client to the server. Recently, I started playing with using publish-subscribe in order to give some realtime information to my users. In this case, real-time only means every 5 seconds my server-side node-based client will publish an event to a public node. When the clients are logged in, all is well… well almost…

Symptom: A flood of subscription events are received in bursts to the client from the server in certain instances (see detail below). And the server traffic (packets per minute) in statistics reflect this as well. Just in the course of writing this note, I’ve received over 100,000 events from the server. Ouch.

Naturally this doesn’t happen all the time, but fortunately it is at least repeatable. Here’s the baffling part to me. It seems to be related to whether I make the subscription after a simple login on our dashboard page or I do it from within our full-fledged application. The dashboard does a connect or reattach based on having a remembered rid/jid/sid (or not) and then does an unsubscribe followed by a subscribe. The application, of course, is more complex and it will do a login (connect or reattach) using the same exact JS code and unsubscribe / subscribe identically (again - same JS code). The difference is that the application will then send its presence to a particular JID and it will also send some IQ messages to the same entity that is doing the publishing and then it will send its presence into a MUC room. Before it even gets a chance to enter the room, a hundred or so subscribe events have arrived.

As a further investigation, I did turn on debug logs on our dev server and noticed the following (near flood) of messages when tailing the debug.log file. So it seems that the server is trying to send subscription events to JIDs which are no longer logged in. Hmm… (I’ve modified these stanzas to protect the guilty – substituted ‘username’ and ‘servername’ from the real entites)

2013.03.19 15:55:48 org.jivesoftware.openfire.spi.RoutingTableImpl - RoutingTableImpl: Failed to route packet to JID: username@servername/37c36ef packet: 8pY5qm2SN0jxzd8A37i5PPVTl29YqDAj0X45mw8P

2013.03.19 15:55:48 org.jivesoftware.openfire.spi.RoutingTableImpl - Unable to route packet. No session is available so store offline. 8pY5qm2SN0jxzd8A37i5PPVTl29YqDAj0X45mw8P

If you’d like to try this yourself, send me a pm and I’ll be happy to give a quick tutorial on how to do it and see it happen live in-virtual-person.

I really want to use pubsub. I could do this a different (and less traffic-laden) way, but ultimately I’d like to use pubsub for other features in the future and this would be a killer of using it.

Lastly - I did do a switch from 3.7.x to 3.8.x PRIOR to doing this work effort, so I cannot comment on whether this is a 3.8.x problem or not. Sigh.

Thanks!

Bob Wolff