Uploaded image for project: 'Openfire'
  1. OF-855

Openfire looses messages when multiple senders send messages to the same receiver that looses connection

    Details

    • Type: Bug
    • Status: Resolved (View workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 3.9.3
    • Fix versions: 3.10.0
    • Components: Core
    • Labels:
      None

      Description

      when multiple senders send messages to the same receiver in parallel it can happen that Openfire losses messages and do not call backup deliverer when receiver looses connection in the meantime.

      The problem is in org.jivesoftware.openfire.session.LocalClientSession.deliver(Packet). There it gets checked if the connection is closed. If this is the case then the packet is dropped silently. You can reproduce this with breakpoints. Example sequence to reproduce:

      • sender2 is in org.jivesoftware.openfire.session.LocalClientSession.deliver(Packet) before the if statement
      • sender1 thread is in org.jivesoftware.openfire.nio.NIOConnection.deliver(Packet)
      • sender1 thread catches IOException and closes connection
      • sender2 now evaluates if statement and silently drops packet

      The expected behavior myself was that Openfire uses the offline cache strategy for this packet now.

      I do not know the Openfire code in detail, but I think the org.jivesoftware.openfire.Connection.isClosed() check can be simply removed. org.jivesoftware.openfire.nio.NIOConnection.deliver(Packet) and org.jivesoftware.openfire.net.SocketConnection.deliver(Packet) do the check again anyway and pass the packet do backup delivery if connection is closed.

      Thanks a lot
      Daniel

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                Tom Evans
                Reporter:
                Daryl Herzmann
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: