Reputation: 1073
I'm using Java on Google App Engine, and many libraries (including the client library of Google Cloud Pubsub) requires "graceful shutdown" when the Java process is terminated.
This is usually done by implementing some custom finalizer, but I'm uncertain how each instance is terminated in Google App Engine (i.e. whether SIGKILL or SIGTERM, or even shutdown of virtual instance).
How do I realize a "graceful shutdown" with Google App Engine?
Upvotes: 0
Views: 440
Reputation: 11370
You have not said whether you are using Standard or Flexible, and whether you are using Automatic, Basic, or Manual scaling. But I think you'll find your answer at:
https://cloud.google.com/appengine/docs/standard/java/how-instances-are-managed
If you need certain cleanup to occur before an instance shuts down, you may need to handle the /_ah/stop
url that GAE will send.
Upvotes: 2