tyrus
  1. tyrus
  2. TYRUS-288

WebSocket connections are automatically closed after 30 idle seconds in standalone mode

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.3
    • Fix Version/s: 1.4
    • Component/s: server
    • Labels:
      None

      Description

      It appears that org.glassfish.tyrus.container.grizzly.server.GrizzlyServerContainer uses org.glassfish.grizzly.http.server.HttpServer to listen for the initial HTTP UPGRADE request that starts a WebSocket connection.

      The problem is that HttpServer.configureListener() adds an IdleTimeoutFilter to the Grizzly FilterChain. This causes the connection to die after (by default) 30 seconds without activity, even after it is no longer really an HTTP connection.

      This behavior goes away if you add a line that removes the IdleTimeoutFilter from the listener's FilterChain in the "start" method in GrizzlyServerContainer.java.

      I've also tried calling IdleTimeoutFilter.setCustomTimeout in GrizzlyServerFilter.handleHandshake under "case SUCCESS:" to set the timeout duration for the current connection to IdleTimeoutFilter.FOREVER. This seems to work as well.

      (No exact patches as I don't have access to a printer right now to send in a signed OCA)

        Activity

        Hide
        Pavel Bucek added a comment -

        Thanks for report.

        This was already fixed as part of TYRUS-275 (I noticed that when testing shared container feature). You can try using 1.4-SNAPSHOT and verify the fix.

        Regards,
        Pavel

        Show
        Pavel Bucek added a comment - Thanks for report. This was already fixed as part of TYRUS-275 (I noticed that when testing shared container feature). You can try using 1.4-SNAPSHOT and verify the fix. Regards, Pavel

          People

          • Assignee:
            Pavel Bucek
            Reporter:
            brian_gordon
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: