How to implement downtime for my Java app

46 views
Skip to first unread message

Arvind Rao

unread,
Oct 13, 2011, 12:24:13 PM10/13/11
to google-a...@googlegroups.com
Hello there

I have a Java-based app hosted on GAE. I want to schedule daily downtime for my app to clean up the datastore. 

a) Is there any way I can bring down the app (i.e. stop serving requests from users and cron jobs), so that I can do a manual clean up using the Datastore Viewer or Admin? Right now if I disable the app, I'm not allowed to - "Sorry, that operation is not allowed while the application is disabled.".

b) If (a) is not possible, is there is any way I can temporarily disable just the scheduled cron jobs? They fire every minute and update the datastore, so if I can disable them that might be sufficient time for me to do a quick manual cleanup.

Apologies if I missed this in the documentation or somewhere online, but so far I couldn';t find any answers on the web.

Thanks
Arvind

Timofey Koolin

unread,
Oct 14, 2011, 3:37:13 PM10/14/11
to google-a...@googlegroups.com
I see 2 ways:
1. create "empty" version for your application with return "OK" (or other text) for any request and do not do any else. For dowtime you will make "empty" as default version, than return your usual version.
2. Make any property such as "downtime" in memcache & db and check it for every request and if it is true - do nothing.

2011/10/13 Arvind Rao <arvind...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/c_XwndvXyGEJ.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.



--
С уважением,
Кулин Тимофей.

Телефон: +7 (4852) 974793
ICQ: 114902104
email: tim...@koolin.ru
Blog: http://timofey.koolin.ru

Christopher

unread,
Oct 14, 2011, 4:03:44 PM10/14/11
to Google App Engine
You should be able to create a Filter (extend javax.servlet.Filter)
which you then add to the web.xml. It will pass you the request/
response objects before the servlet/services are invoked to handle
them. Using this you can filter out most responses to return a
maintenance page, but allow certain IP's to pass through (typically
all the localhost IPs as well as your own).

On Oct 13, 12:24 pm, Arvind Rao <arvindrao....@gmail.com> wrote:
> Hello there
>
> I have a Java-based app hosted on GAE. I want to schedule daily downtime for
> my app to clean up the datastore.
>
> a) Is there any way I can bring down the app (i.e. stop serving requests
> from users and cron jobs), so that I can do a manual clean up using the
> Datastore Viewer or Admin? Right now if I disable the app, I'm not allowed
> to - "*Sorry, that operation is not allowed while the application is
> disabled.*".

nischalshetty

unread,
Oct 14, 2011, 7:00:25 PM10/14/11
to google-a...@googlegroups.com
Just curious, is there a particular reason why you decided to clean up the database everyday rather than letting the data stay?

Arvind Rao

unread,
Oct 14, 2011, 11:06:23 PM10/14/11
to google-a...@googlegroups.com
great, thanks all for your suggestions!

@nischal, it's a new app and i'm still sorting out some kinks, often get some bad data in there. since it's non-critical, i prefer to wipe out everything.


nischalshetty

unread,
Oct 17, 2011, 10:14:02 PM10/17/11
to google-a...@googlegroups.com
makes sense... you can run a map reduce to do that.... search for map reduce for appengine... 
Reply all
Reply to author
Forward
0 new messages