Tuesday, August 6, 2013

Re: seamless rpc during upgrades

We have a web server proxy before the app servers (GWT client code is served from this web server and not from the app server). On the app server we can deploy as many versions as we want and on the web server proxy we configure which customer should access which deployed version. So basically we deploy a new version and if deployment is successful then switch all customer to the new version by reconfiguring the web server proxy.

In the code we catch all GWT-RPC related exceptions (SerializationException, IncompatibleRemoteServiceException, etc.) that can occur once old client code hits a new server. In these cases we display a message "Your app has been updated. App will reload" and then reloading the app. Also in GWT.runAsync() calls we catch 404 errors and assume that the customer has an old version and tries to load an old split point that does not exist anymore on the server => message + app reload (split point fragments are stored in deferredjs/<permutation>/x.cache.js where <permutation> can be out of date).

If only client side changes have been made and GWT-RPC does not throw any exceptions then the app can only reload if a split point fails to load. If a customer already has all split points of the old app downloaded, then the customer will only get the new code once the browser is manually reloaded. Not sure how to automate this case. Depending on the things fixed in client code we sometimes change some serializable classes to force GWT-RPC to fail and thus automatically reloading the app.

We also have a small solution if we ever need a downtime for any given customer so that the app automatically reloads itself but then shows a downtime web site which refreshes itself until downtime is done and the app reappears. This is all done on the web server proxy.

Works pretty well for us.

-- J.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment