Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2854

Incorrect behavior: Resteasy Server Sent Events implementation incorrectly triggers an OnError event when an HTTP 503 occurs.

    XMLWordPrintable

Details

    • ---
    • ---

    Description

      The javax.ws.rs.sse.SseEventSource javadoc states the onError "Throwable consumer is invoked upon a unrecoverable error encountered by a SseEventSource".  It also states the following:

      "In addition to handling the standard connection loss failures, JAX-RS SseEventSource automatically deals with any HTTP 503 Service Unavailable responses from an SSE endpoint, that contain a "Retry-After" HTTP header with a valid value. ... In case a HTTP 503 + "Retry-After" response is received in return to a connection request, JAX-RS SSE event source will automatically schedule a new reconnect attempt and use the received "Retry-After" HTTP header value as a one-time override of the reconnect delay."

      The current implementation in Resteasy does perform the reconnect/re-try specified.  However in addition to this, it also produces an onError event and sends this to the registered Throwable consumers.    This is not correct behavior. OnError events should only be sent upon unrecoverable errors that occur during event processing.

      The org.jboss.resteasy.test.providers.sse.SseReconnectTest.testSseEndpointUnavailable() test currently verifies this incorrect behavior and will need to be fixed when this is addressed.

      Attachments

        Activity

          People

            rsigal@redhat.com Ronald Sigal
            jim_krueger Jim Krueger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: