-
Notifications
You must be signed in to change notification settings - Fork 78
Description
Depending on particular user cases of gRPC server there might be (and there are in fact) cases where hard-coded 30 seconds is not enough to gracefully terminate currently open connections. This value better be customizable and left up to the library users to decide how long it should wait before forcible closing the connections.
In Network.GRPC.LowLevel.Server module (core/src/Network/GRPC/LowLevel/Server.hs file) in stopServer function there is this line:
shutdownEvent <- pluck scq shutdownTag (Just 30)Here 30 seconds timeout is hard-coded. I guess Server data-type of this module can be extended to hold time graceful termination timeout value to use for that pluck function.
This value can be added to Network.GRPC.HighLevel.Generated.ServiceOptions data type and this 30 seconds can be set as default for Network.GRPC.HighLevel.Generated.defaultServiceOptions so there a user would customize the value. And then at some point it would be passed to the Server (probably to ServerConfig first?).