Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] EventSourceServlet timing out

Hi,

This is not the AsyncContext idle timeout firing but the connection idle timeout.

So I would review your configuration when configuring the server, somewhere the idleTimeout is being configured to 5000ms.
Most likely on the ServerConnector or HttpConfiguration.

cheers,
Lachlan

On Mon, Apr 6, 2026 at 9:51 PM Nils via jetty-users <jetty-users@xxxxxxxxxxx> wrote:

This is Jetty 12.1.18, but also exists in prior versions.

My webapp, using the EventSource API kept getting called on the onerror function. Not all the time, it does receive data from the org.eclipse.jetty.ee11.servlets.EventSource implementation.

I turned on debugging to figure out what was going on, and it seems like a TimeoutException is triggering the EventSource.onClose() method. I’m pretty sure this shouldn’t happen, as this code (from EventSourceServlet) is presumably disabling timeouts:

respond(request, response);
AsyncContext async = request.startAsync();
// Infinite timeout because the continuation is never resumed
// but only completed on close
async.setTimeout(0);
EventSourceEmitter emitter = new EventSourceEmitter(eventSource, async);
emitter.heartBeat = scheduler.schedule(emitter, heartBeatPeriod, TimeUnit.SECONDS);
open(eventSource, emitter);

but, alas, something is not going as expected. I've attached a screenshot of the debugger:

Screenshot 2026-04-06 133742.pngScreenshot 2026-04-06 133856.png


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top