https://bz.apache.org/bugzilla/show_bug.cgi?id=67235

--- Comment #3 from brigh...@toss.im ---
I did not use HTTP2.
This issue occurred when setting up SSE (Server-Sent Events), and it's expected
that this could always happen when using an asynchronous servlet.

I'm building a server using the Spring Framework, and I'll briefly attach some
sample code below that could cause this issue when running with embedded Tomcat
as the web application server.

```
class EventStreamV2Controller {

    @GetMapping(value = ["/sse"], produces =
[MediaType.TEXT_EVENT_STREAM_VALUE])
    fun connectStream(): SseEmitter {
        val sseEmitter = SseEmitter(Duration.ofSeconds(10).toMillis())

        Thread {
            Thread.sleep(Duration.ofSeconds(5).toMillis())
            sseEmitter.send("message")
        }.start()

        return sseEmitter
    }
}

```

When there is an API like the one described above, if the client preemptively
terminates the SSE connection within 5 seconds after making the connection
request, an issue occurs at the point when sseEmitter.send("message") is
called.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to