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

Deadlock while sending sse events when first event is not yet send

XMLWordPrintable

      After an upstep to Wildfly 25.0.0.Final we are seeing a deadlock in the sse sending code.

      The problems happens when you try to send an event while the first event for that sink is still being processed, as the first event will take its locks in different order than the other event.

      We have extended org.jboss.resteasy.test.providers.sse.SseEventSinkTest with a reproduction scenario (PR coming up).

      Attached you find the relevant stacktraces from this reproduction scenario.

      The first element will send its event asynchronously, where it will take first the lock on the HttpServletResponseWrapper$DeferredOutputStream only then try to take the lock on the SseEventOutputImpl.  While other events are handled synchronously and will take the lock in the reverse order.  This can deadlock.

       

              jperkins-rhn James Perkins
              steven.aerts Steven Aerts (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: