Appengine standard java shutdown callback

54 views
Skip to first unread message

Linus Larsen

unread,
Sep 11, 2018, 9:07:53 AM9/11/18
to Google App Engine
I'm using pubsub with batching and I wan't to be able to drain the queue on any pontential messages before the instance shutdown.
Piece of cake I thougt, just call shutdown() in LifecycleManager.shutdown(), end of story. However I'm running my instances with
autoscaling and there seems to be no way to get a proper callback when the servlet container is shutting down.

  • LifecycleManager listener only works with manual and basic instance classes // as per documentation 
  • ServletContextListener.contextDestroy is never invoked by appengine // as per documentation
  • "_ah/stop" is never called on auto scaled instances // as per documentation

Surely there must be a way of getting notified when an instance is about to shut down?


Linus Larsen

unread,
Sep 12, 2018, 3:39:46 PM9/12/18
to Google App Engine
FK, I filed a feature request, https://issuetracker.google.com/issues/114794562

Katayoon (Cloud Platform Support)

unread,
Sep 13, 2018, 11:35:04 AM9/13/18
to Google App Engine
As you pointed to this case in your feature request, shutdown hooks only work for manual scaled instances on the standard runtime. So, tracking your feature request is recommended for this case.
Reply all
Reply to author
Forward
0 new messages