Bug In Disconnection of Tigase bosh mode ?
Hi every body,
In my Tigase Beta 3 on Debian,
I have discover than when I disconnect a bosh client, I send a presence with the type at unavailable.
But the server answer a code 503...
and in the Tigase log I look that :
Message without TO attribute set, don't know what to do wih this:
DATA=<presence type="unavailable" xmlns="jabber:client"/>,
SIZE=52, XMLNS=jabber:client, PRIORITY=PRESENCE,
There might be a period of time when the user session on SM gets out of sync with user's Bosh session. So the Bosh sends a packet to SM but there is no session for this connection. Therefore the SM cannot process the packet.
It is hard to say whether this is a bug or a normal situation without investigation and looking into logs on both the client and the server side.
I have that in my logs before, it's personal logs :
2011-06-29 17:05:01 XMPPResourceConnection.streamClosed() SEVERE: CLOSING STREAM
2011-06-29 17:05:01 XMPPResourceConnection.removeParentSession() SEVERE: REMOVE PARENT SESSION
But we can look that the stream are closed before the error of processing packet.
In client side, strophe.js send his packet (it's not the same test, I say that for rid, sid. The user is the same, and the error are the same):
<body rid='481250670' xmlns='http://jabber.org/protocol/httpbind'
<presence xmlns='jabber:client' type='unavailable'/>
Coming : <body secure='true' from='******' xmpp:version='1.0' ack='481250669' type='terminate'
<presence type='error' xmlns='jabber:client'>
<error type='cancel' code='503'>
Service not available.
I think I know why this happens. As the client sends unavailable presence stanza in the same body as terminate attribute, the Bosh session is sending connection termination signal to the session manager along with the presence unavailable.
Because of how internals in the Tigase server works the connection termination is handled before the presence unavailable stanza. The error and the rest is just a result of this.
I have created a ticket for this which will be resolved at earliest possible time: https://projects.tigase.org/issues/188