Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add graceful shutdown to sansshell proxy (#468)
SIGTERM is sent by orchestration platforms like Kubernetes to initiate graceful termination. We can listen for it and use grpc's GracefulStop, which will refuse new RPCs and continue serving existing RPCs. This graceful behavior can give a better user experience for ongoing streaming RPCs by allowing them to run during termination. I'm only doing this for proxy and not server because server tends to have a lifetime coupled to the node it serves and proxy tends to have a lifetime separate from servers. I've intentionally put this as behavior that unconditionally happens instead of as an option. I'm having trouble thinking of a case where someone wouldn't want this. We can turn it into an option if we find a reason to do so.
- Loading branch information