Bosh client disconnects randomly


My client uses strophe library to connect with Openfire using BOSH. The client retries the request if server response is not received within a specified time duration which is wait time + 6 secs(to account for network delay). But the server sometimes closes the session when it receives a request with same request id. In the server logs, we see :

Deliverable unavailabe for 7325364675326

and sends an error to client with type=‘terminate’ condition=‘item-not-found’

This behavior is making our client very unstable. I believe openfire should be able to handle duplicate packets properly.

So is it something my client doing wrong or is it expected behavior?

I have simlar issue.

I have been looking into openfire 3.8.1 source code to debug this issue. So far I have come to the conclusion that whenever server receives a request, if the request id is same as last request id it has processed, it looks into the list of buffered responses (sentElements) for that request id. If its not able to find the delivered response in the list, it terminates the client session.

But the problem is, whenever server sends back an empty response after waiting for entire duration of wait period, it does not update the response buffer. Only last request id is being updated.

Can somebody please verify this and if this is actually causing my client to disconnect, how can i fix it?