Open unclechu opened 1 year ago
@unclechu this sounds like a useful change! Thanks for documenting it :)
We're very busy within Arista at the moment so we're unlikely to get to this unless this became a blocker for someone. We're very open to contributions though, so if you implement this for yourself, please consider making it a pull request!
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) instopServer
function there is this line: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 thatpluck
function.This value can be added to
Network.GRPC.HighLevel.Generated.ServiceOptions
data type and this 30 seconds can be set as default forNetwork.GRPC.HighLevel.Generated.defaultServiceOptions
so there a user would customize the value. And then at some point it would be passed to theServer
(probably toServerConfig
first?).