Closed zigster64 closed 1 year ago
Note - broken connections are easy enough to replicate when you have long running SSE handlers.
The client exits the app (close browser window), which means the SSE event handler will sit idle until the next event to be emittted, at which point it will get a error.BrokenPipe when attempting to write to the connection.
Thanks, I added ConnectionResetByPeer
When there is an error due to a broken connection, the existing logic treats this as a standard error, which then calls an error handler and/or writes some error code to the response.
We should treat IO errors as a different case - and not attempt to write to the known-broken connection.
Attempting to write to the connection may also create some allocations that we wont need as well (ensureSpace on the buffer)