Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-3955

WebSocket Transport - Race condition starting transport

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.6.0
    • Fix Version/s: 5.7.0
    • Component/s: None
    • Labels:
      None

      Description

      In the StompServlet, when a websocket request comes in, we are starting up the broker's websocket connection when we call listener.onAccept(socket).
      Under the covers, it begins a task in a new thread to create the connection, instantiate the transport listener, and set the listener on the transport. However, this is done asynchronously, and when the StompServlet calls listener.onAccept(socket), it immediately returns to the underlying jetty websockets implementation, returning the StompSocket (which as the websocket onTextMessage listener). It seems it's possible the jetty code could call back the onTextMessage listener's onMessage(...) method and expect the StompSocket to process the Stomp message before the steps taken to complete creating the connection from the async listener.onAccept(..) call.

        Attachments

          Activity

            People

            • Assignee:
              dejanb Dejan Bosanac
              Reporter:
              dejanb Dejan Bosanac
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: