watchdog concerns

Igor Khomenko
Added over 3 years ago

Hi there,

we are plying with watchdog settings to make Tigase detect broken connections and close them

Our settings:


Our scenario:

User is logged in on iPad or Android device. Then we just switch off the wifi connection


Tigase still thinks that the connection is active

We checked and found the following if:

                                        if ( curr_time - lastTransfer >= ( watchdogTimeout ) ){

                                            /** At least once every configured timings check if the
                                             * connection is still alive with the use of configured
                                             * ping type. */
                                            switch ( watchdogPingType ) {
                                                case XMPP:
                                                     pingPacket = Iq.packetInstance( pingElement.clone(),
                                                         JID.jidInstanceNS( (String) service.getSessionData().get( XMPPIOService.HOSTNAME_KEY ) ),
                                                         JID.jidInstanceNS( service.getUserJid() ) );
                                                    if ( !writePacketToSocket( (IO) service, pingPacket ) ){
                                                        // writing failed, stopp service

                                                case WHITESPACE:
                                                    service.writeRawData( " " );

It doesn't produce any exceptions, we just see that Tigase runs it every 10 seconds, but nothing happened

Should we enable something in addition?

we use tigase 7.0.1

Replies (1)

Added by Wojciech Kapcia TigaseTeam over 3 years ago

It may happen that TCP implementation of underlying operating system implements resending of the packet so the actual discovery may take somewhere from 13 to 30 minutes. You can adjust tcp_retries2 parameter to limit number of attempts and virtually speed up discovery.