OpenFire loses messages if client connection is broken

Hello, everybody.

I am experiencing following problem. We have an OpenFire 3.8.2 server and a client application on Android phones based on ASmack. Everything works well most of the time, but sometimes messages are being lost. The exact time interval when messages are being lost is between loosing internet connectivity on the phone and until idle timeout in OpenFire. Here are exact steps to reproduce the problem:

  1. start client A on the phone, ensure that it’s online in the OpenFire admin console

  2. send some messages to A from the other client B on other device (computer, etc), these messages are delivered successfully

  3. turn off internet (wi-fi, 3g) on the phone, client A is still online for some time in OpenFire admin console (this is ok according to this: http://community.igniterealtime.org/thread/39760)

4. while internet connection on the phone is turned off and client A is online, send some messages to it from B, these messages are being lost. I mean, they obviously are not delivered to client A, but also they are not stored in the offline storage

  1. wait until client A is offline in OpenFire admin console

  2. send some messages from A to B, these messages are stored in offline storage and will be correctly delivered after client A restores connectivity

When I look at the broken connection with netstat after step 4, I see that it’s still ESTABLISHED (and it’s ok until some timeout), but with nonzero Send-Q (which, as I learned, indicates that some data were sent to the client, but delivery was not confirmed). So, the operating system knows that connection is broken, or at least sees some problems on it (and I believe this is what TCP is used for), but OpenFire does not.

Is there some option to allow OpenFire detect such situations and put undelivered messages to the offline storage and not loose them? Or maybe it is a bug in the OpenFire?

Related topic http://community.igniterealtime.org/message/232352#232352