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.