Project

General

Profile

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:

c2s/watchdog_delay[L]=2000
c2s/watchdog_timeout[L]=10000

Our scenario:

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

Result:

Tigase still thinks that the connection is active

We checked ConnectionManager.java 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
                                                        ++watchdogStopped;
                                                        service.stop();
                                                    }
                                                    break;

                                                case WHITESPACE:
                                                    service.writeRawData( " " );
                                                    break;
                                            }
                                            ++watchdogTests;
                                        }
                                    }

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.

    (1-1/1)