Jetty
  1. Jetty
  2. JETTY-1463

WebSockets with Safari gets messages stuck as if in a buffer that needs to be flushed.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 8.0.1
    • Fix Version/s: None
    • Component/s: NIO
    • Labels:
      None
    • Number of attachments :
      1

      Description

      When using Safari, sending several messages through a websocket will lead to some of them not getting through right away. The last few messages often don't arrive until another message is sent later through the websocket to flush them out.

      To reproduce, put this in Safari's debug console:
      var x = new WebSocket('ws://localhost:8080/conn/')
      for(i in [1, 2, 3, 4, 5]) x.send('x')

      If you put a breakpoint in the onMessage method of your WebSocket.OnTextMessage handler, it will only get triggered twice, when it should have been triggered 5 times.

      If in Safari you then type:
      x.send('x')

      The remaining messages will all come through and trigger the breakpoint another 4 times.

      A look at WireShark suggests that Safari is in fact sending the messages, but for whatever reason they aren't propagating up into the WebSocket servlet. I traced the bug into the code and discovered that even if I put a breakpoint at SelectChannelEndPoint.schedule, it still wasn't being called for the missing messages, so it must be somewhere even farther down than that.

        Activity

        Hide
        Jan Bartel added a comment -

        Greg, you were the last to look at this issue, is it fixed?

        thanks
        Jan

        Show
        Jan Bartel added a comment - Greg, you were the last to look at this issue, is it fixed? thanks Jan
        Hide
        Vicente Ruiz added a comment - - edited

        Hi there,

        I think that we are experiencing a similar problem.

        Here an explanation of our issue (in Apache Wave using jetty 8.1.1 and later 8.1.4):

        https://issues.apache.org/jira/browse/WAVE-358

        See for websocket frames:
        http://homes.ourproject.org/~vjrj/otros/websocket-stuck.svg

        the frame 9 (<-) should be the response for frame 7 (->) but the connection stucks in 7 til a new client petition is generated, that is frame 8 (->).

        So the question is, can be related with this issue? is it fixed?

        Show
        Vicente Ruiz added a comment - - edited Hi there, I think that we are experiencing a similar problem. Here an explanation of our issue (in Apache Wave using jetty 8.1.1 and later 8.1.4): https://issues.apache.org/jira/browse/WAVE-358 See for websocket frames: http://homes.ourproject.org/~vjrj/otros/websocket-stuck.svg the frame 9 (<-) should be the response for frame 7 (->) but the connection stucks in 7 til a new client petition is generated, that is frame 8 (->). So the question is, can be related with this issue? is it fixed?
        Hide
        Vicente Ruiz added a comment - - edited

        For us, the problem seems related with SSL, so probably is a different issue. The websocket messages are send, but for some reason are not received by the client (probably a checksum/corruption problem).

        Show
        Vicente Ruiz added a comment - - edited For us, the problem seems related with SSL, so probably is a different issue. The websocket messages are send, but for some reason are not received by the client (probably a checksum/corruption problem).
        Hide
        Jan Bartel added a comment -

        Assigning to Joakim to update tests as per Greg's post.

        Show
        Jan Bartel added a comment - Assigning to Joakim to update tests as per Greg's post.
        Hide
        Jan Bartel added a comment -

        This issue was moved to jetty eclipse bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=396560

        Show
        Jan Bartel added a comment - This issue was moved to jetty eclipse bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=396560

          People

          • Assignee:
            Joakim Erdfelt
            Reporter:
            Andrew Lee
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: