Skip to content

Is it possible to disable/override ShutdownIdleTimeout during graceful shutdown #13523

@jacob-pro

Description

@jacob-pro

Jetty Version

12.0.22

Jetty Environment

ee10

Java Version

21

Question

When a connector is shutdown gracefully using Connector::shutdown I am expecting it to keep functioning for the existing requests. However it seems to have the side effect of overriding the idle timeout on all connections.

// Reduce the idle timeout of existing connections
for (EndPoint ep : _endpoints)
ep.setIdleTimeout(getShutdownIdleTimeout());

Whilst I realise it is possible to set the shutdown timeout to match my default timeout, e.g.

connector.setIdleTimeout(Duration.ofSeconds(15).toMillis());
connector.setShutdownIdleTimeout(Duration.ofSeconds(15).toMillis());

This doesn't work in cases where individual connections had their own timeout, e.g. for HTTP requests I could have 15 second idle timeouts, but for WebSockets I have set a higher timeout, e.g. 60 seconds.

Configuration.ConfigurationCustomizer customizer = new Configuration.ConfigurationCustomizer();
customizer.setIdleTimeout(Duration.ofSeconds(60));
WebSocketNegotiator negotiator = WebSocketNegotiator.from(creator, serverFrameHandlerFactory, customizer);

Is there any way to disable the shutdown idle override so that the original timeouts are preserved and not all reset to the same value?

Use Case

When shutting down Jetty I don't want to see timeout errors, due to artificially reduced timeouts, since this makes the root cause ambiguous, and can cause requests that would normally succeed to fail. I would like a graceful shutdown to continue processing the existing requests like normal.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions