Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server: Make graceful termination timeout customizable #147

Open
unclechu opened this issue Jan 18, 2023 · 1 comment
Open

Server: Make graceful termination timeout customizable #147

unclechu opened this issue Jan 18, 2023 · 1 comment

Comments

@unclechu
Copy link

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?).

@ixmatus
Copy link
Contributor

ixmatus commented Jan 24, 2023

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants