Hi Jon,

I raised issue http://code.google.com/p/googleappengine/issues/detail?id=5214
on the non-loading requests resulting in instance deaths with
threadsafe on. It was a bit more verbose than it probably needs to be,
but it describes the problem.

If anyone knows another way to detect loading requests that works with
threadsafe on, let me know. There is no guarantee that the servlet
context is loaded during the loading request, so that's out for now,
but if anyone knows another trick it will create options to work
around the problem until a fix is available.

Otherwise, I can disable threadsafe for now. But I'm reluctant - the
efficiency is strangely reassuring..

/Tom



On Jun 21, 1:25 pm, Jon McAlister <jon...@google.com> wrote:
> Hi Tom,
>
> I'm not sure about the servlet context listener code.
>
> However, thanks for pointing out the behavior of the interaction of
> loading requests and threadsafe apps. We are indeed sending down
> non-loading-requests while the instance is still processing the
> loading request. This is problematic (for the reasons you list) and
> something we didn't anticipate. We'll try to get a fix in to one of
> the next releases. If you file it as an external issue we can use that
> to notify when its closed. Until then your suggested workaround is
> good, the other known workaround being to turn off threadsafe.
>
> Thanks for bringing this to our attention.
>
> On Sun, Jun 19, 2011 at 5:11 PM, Tom Phillips <tphill0...@gmail.com> wrote:
> > 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 google-appengine-java@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > google-appengine-java+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine-java?hl=en.
>
>

-- 
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 google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to