You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server and ClientFactory currently calls EventLoopGroup.shutdownGracefully() to terminate Netty EventLoopGroups when they stop or close. shutdownGracefully() incurs 2-3 second delay and it can make the applications suffer when it needs to start and stop frequently.
It'd be nice if Armeria provides a user to customize the graceful shutdown delay of EventLoopGroups, like it does for Server requests, so that they can minimize the amount of time required for tearing down a Server or a ClientFactory.
We could, for example, allow a user to specify a config instead of boolean shutdownOnStop in ServerBuilder and ClientFactoryBuilder methods, e.g.
publicclassGracefulShutdownSpec {
// External resource managed by the caller - don't shut downpublicstaticGracefulShutdownSpecofExternal() { ... }
// Don't shut down gracefully - shut down immediatelypublicstaticGracefulShutdownSpecofImmediate() { ... }
// Shut down gracefullypublicstaticGracefulShutdownSpecof(quietperiod, hardtimeout) { ... }
}
Server
.builder()
.workerGroup(..., GracefulShutdownSpec.of...)
// Could be reused for the existing graceful shutdown settings// Note: `ofExternal` is not allowed here.
.gracefulShutdownTimeout(GracefulShutdownSpec.of...)
...
The text was updated successfully, but these errors were encountered:
It still takes about 2 seconds to shut down the server. I've traced the issue down and it seems, that it originates here: com/linecorp/armeria/server/Server.java:678:
bossGroup.shutdownGracefully();
Which then invokes in io.netty.util.concurrent.AbstractEventExecutorGroup:
It seems, that current settings set in gracefulShutdownTimeout(Duration.ZERO, Duration.ZERO) are not propagated to this place.
I have no opinion on newly proposed configuration API change - I'm just trying to document current behavior which prolongs my automated tests. Thank you.
Server
andClientFactory
currently callsEventLoopGroup.shutdownGracefully()
to terminate NettyEventLoopGroup
s when they stop or close.shutdownGracefully()
incurs 2-3 second delay and it can make the applications suffer when it needs to start and stop frequently.It'd be nice if Armeria provides a user to customize the graceful shutdown delay of
EventLoopGroup
s, like it does forServer
requests, so that they can minimize the amount of time required for tearing down aServer
or aClientFactory
.We could, for example, allow a user to specify a config instead of
boolean shutdownOnStop
inServerBuilder
andClientFactoryBuilder
methods, e.g.The text was updated successfully, but these errors were encountered: