The GAE documentation says you can detect loading requests like this:
// web.xml snippet
<listener>
<listener-class>
com.example.LogLoadingRequest
</listener-class>
</listener>
// LogLoadingRequest.java
public class LogLoadingRequest implements ServletContextListener {
private static final Logger logger =
Logger.getLogger(LogLoadingRequest.class.getName());
public void contextInitialized(ServletContextEvent sce) {
logger.log(Level.INFO, "Loading request occuring.");
}
public void contextDestroyed(ServletContextEvent sce) {
}
}
But I'm finding from my logs that what GAE thinks is a loading request
(identified in log as loading_request=1) and which is given longer
deadline, does NOT always match the request that logs the above
"Loading request occuring." when Threadsafe is on.
Should it, or is this method obsolete for threadsafe instances? Is
there some other way I can detect loading vs non-loading requests with
threadsafe on?
With threadsafe on, non-loading requests are being assigned by GAE to
instances while the loading request is still happening, resulting in
all sort of (Hard)DeadlineExceeded issues in the non-loading requests.
Reason is, loading requests are showing huge slow down and variance in
loading times lately, often exceeding the 30 seconds that non-loading
request are allowed - even though in my case loading should only take
about 4 seconds (jaxb,PMF) plus whatever classloading and jvm startup
takes. Worst thing is, these exceptions bring down the instance before
loading can even finish, requiring multiple startup attempts. I'm
trying to work around it by detecting loading vs. non-loading requests
and in non-loading either doing a no-op if not critical, or proxying
via urlfetch through to a backend until the loading request is
complete.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.