2

my gRPC service uses grpc-gateway to serve http requests.

in order to make the service shutdown gracefully, is there an order i need to pay attention to? i.e. is the shutdown order

A. gRPC service -> gateway

B. gateway -> gRPC service

the only article/document i can find is here, which recommend A but didn't explain why. my own reasoning for A would be we need the gateway to be alive to route the outstanding gRPC requests. but that's not supported by any documentation.

kimmy
  • 21
  • 1
  • grpc gateway is just a proxy over grpc, I believe one should stop the grpc server before shutting down the proxy. – manask322 Jun 11 '21 at 09:54

1 Answers1

0

from this link you've shared is not clear the motivation of shutdown first grpc service and them rest gateway.

But here is my reasons I gracefully shutdown first rest gateway:

  • rest gateway depends on grpc service
  • shutdown grpc do not wait for rest processing its stuff (it causes errors) and 503 responses. (specifically to me it causes bad results on my SLOs metics)
alvesoaj
  • 512
  • 5
  • 16