I'm running a Google App Engine production server, using basic_scaling
as the scale type. Whenever I update the code and deploy it - using gcloud app deploy
- the old version of the code is shutdown.
According to the documentation, that's expected:
The shutdown process might be triggered by a variety of planned and unplanned events, such as:
- You manually stop an instance.
- You deploy an updated version to the service.
- ...
I understand that it's easier for most developers that way. But in my case, I'd like to keep the old versions running until the idle_timeout
limit is reached. Does anyone know if there's a way to avoid the automatic shutdown and let the old versions to shutdown by themselves?
CodePudding user response:
Per Google's documentation, when you deploy your code, the default flag of --stop-previous-version
is used. This forces the previous version to be stopped. If you do not want that, you should explicitly use the --no-stop-previous-version
in your deploy command (we also have this as a feature on our App, a GUI for GAE; you check or uncheck a checkbox).
Unfortunately, Google does not provide a way for the service to automatically shut down later. You'll have to manually shut it down and start the other version later.