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

Concurrency issue in sse events GET and send

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 3.14.0.Final
    • None
    • None

    Description

      Before the servlet dispatched the sse GET method in one thread like below code example, sse event sending to SseEventSink with POST method is already started in another thread.

      @GET
       @Produces(MediaType.SERVER_SENT_EVENTS)
       public void getEvents(@Context SseEventSink eventSink)
            this.eventSink = eventSink;
        }
       @POST
       public void send(String message) {
              ....
              sseSink.send(sseEvent);
       }
      
      

      The sequence like this:

      1353510:12:48,696 ERROR [io.undertow.request] (default task-3) UT005080: HttpServerExchange cannot have both async IO resumed and dispatch() called in the same cycle
      1353610:12:48,704 ERROR [io.undertow.request] (default task-3) UT005071: Undertow request failed HttpServerExchange{ GET /SseAPITest/apitest/events}: java.lang.IllegalStateException: UT000002: The response has already been started
      

      Attachments

        Issue Links

          Activity

            People

              rhn-engineering-ema Jim Ma
              rhn-engineering-ema Jim Ma
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: