google-code-export / objectify-appengine

Automatically exported from code.google.com/p/objectify-appengine
MIT License
1 stars 0 forks source link

HardDeadline in ObjectifyFilter processAllPending #167

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

We experienced a intermediate HardDeadLineException problem with 
ObjectifyFilter. StackTrace is the following:

java.util.concurrent.ExecutionException: 
com.google.apphosting.api.DeadlineExceededException: This request 
(a1c56f90f61cca1b) started at 2013/06/25 21:57:45.202 UTC and was still 
executing at 2013/06/25 21:58:44.620 UTC.
    at com.google.appengine.api.utils.FutureWrapper.setExceptionResult(FutureWrapper.java:63)
    at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:94)
    at com.googlecode.objectify.cache.TriggerFuture.get(TriggerFuture.java:102)
    at com.googlecode.objectify.cache.Pending.completeAllPendingFutures(Pending.java:102)
    at com.googlecode.objectify.cache.PendingFutures.completeAllPendingFutures(PendingFutures.java:78)
    at com.googlecode.objectify.cache.AsyncCacheFilter.complete(AsyncCacheFilter.java:69)
    at com.googlecode.objectify.cache.AsyncCacheFilter.doFilter(AsyncCacheFilter.java:61)
    at com.googlecode.objectify.ObjectifyFilter.doFilter(ObjectifyFilter.java:49)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)

What is the expected output? What do you see instead?

Should be handled on ObjectifyFilter level. And not exposed to application 
stack as exception. Actually filter can use some kind of StopWatch to wait on 
unfinished futures but not expose HardDeadline.

What version of the product are you using? On what operating system?

4.0b1

Original issue reported on code.google.com by k.lebe...@electionear.com on 1 Jul 2013 at 7:29

GoogleCodeExporter commented 9 years ago
What exactly do you propose Objectify do with a HardDeadlineException? Mask it 
from application code so your app fails silently?

Original comment by lhori...@gmail.com on 1 Jul 2013 at 10:25

GoogleCodeExporter commented 9 years ago
Do not think that silent fail is a good approach. But this approach is not 
helpful also. I do not know that any operation is timeouted. And logs just show 
me that I am out of my 60 sec deadline. So even if I will put some filter 
before Objectify filter to do some clean up I will just do not have time to do 
it, cause request is already failed. Probably it would be a good idea to be 
able to register some General error handler and call it with exception before 
deadline (probably a couple of seconds before it).

Original comment by k.lebe...@electionear.com on 1 Jul 2013 at 11:05

GoogleCodeExporter commented 9 years ago
I'm not quite sure what you want Objectify to do for you. GAE throws the 
exception and it's up to you to catch it. This isn't even a datastore-specific 
issue; that exception can be thrown from any blocking operation within GAE, 
such as the task queue and urlfetch apis.

You can create a servlet Filter which catches this exception. There's nothing 
special about Objectify and no reason why Objectify should be responsible for 
it.

Original comment by lhori...@gmail.com on 2 Jul 2013 at 6:21