Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-76782

thinko/typo in qmqttconnection - more than one pending ping response needed

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • P2: Important
    • 5.14
    • 5.13.0
    • MQTT
    • None
    • Android, Linux/X11
    • dcf3bbb9802f9adf79ae08d5d697b3ded3f0cb97

    Description

      QTBUG-74279 resulted in change id I6d8e540f7e89c621e5c010669085882d25440b0a

      The goal was to follow spec in that client side the connection should be closed upon not receiving a ping response.

      The implementation depends on counting pings and responses.

      The comment states:

      " // Consider two pending PINGRESP as reasonable."

      and then the QMqttConnection::sendControlPingRequest() code states:

      m_pingTimeout > 1

       

      When a client sets a keepalive, it will also send corresponding pings and then a single pending pingresp seems reasonable.

      However, QMqttClient::requestPing() exists, allowing one to manually trigger a ping as well. Since QMqttClient doesn't allow informing the broker about a keepalive without sending automatic pings, any manually sent ping will be in addition to the automatically sent ones. Therefor, allowing only a single pending ping response causes 'unexpected client disconnects' by QMqttClient.

      The usecase for sending manual pings is Android -> since the Qt process can be put asleep, one cannot trust the automatically sent pings to keep the connection alive. So we're triggering the manual pings periodically from the Android side, which caused QMqttClient to sometimes disconnect thinking it was missing ping responses.

      When checking for "m_pingTimeout > 1" in QMqttConnection::sendControlPingRequest() maybe manually sent pings can be taken into account (i.e. the value 1 gets increased upon a manual ping and decreased upon a ping response with a minimum of 1 or something along that line).

       

      Attachments

        For Gerrit Dashboard: QTBUG-76782
        # Subject Branch Project Status CR V

        Activity

          People

            mkalinow Maurice Kalinowski
            jirauser24743 user-678dd (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes