When writing a Cloud Run service, we develop a container that listens on the PORT
environment variable to handle an incoming HTTP request. An instance of the container springs to life and handles the request and then lives a while longer after concluding the original request in case there are further requests to arrive. If there are no further requests, GCP shuts down the container. It is in this area that I have a question.
Is there a hook, signal or other indication that the container is being shut down within the container?
In my example, my container wants to cleanly end. Perhaps it wants to close connections or perform some quick flush of cache.