title: Handling a Cloud Run container shutdown
body: <p>When writing a Cloud Run service, we develop a container that listens on the <code>PORT</code> 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 <em>shuts down</em> the container.   It is in this area that I have a question.</p>
  
  <p>Is there a hook, signal or other indication that the container is being shut down within the container?  </p>
  
  <p>In my example, my container wants to cleanly end.  Perhaps it wants to close connections or perform some quick flush of cache.</p>