0

When I try to lease tasks from a pull queue in my application, I get the error below. This didn't happen previously with my code, so something has changed. I suspect that it's a threading issue - these calls are made in a separate thread (created using ThreadManager.createThreadForCurrentRequest) - has that recently been disallowed?

uk.org.jaggard.myapp.BlahBlahBlahRunnable run: Exception leasing tasks. Already tried 0 times.
com.google.apphosting.api.ApiProxy$CancelledException: The API call taskqueue.QueryAndOwnTasks() was explicitly cancelled.
    at com.google.apphosting.runtime.ApiProxyImpl.doSyncCall(ApiProxyImpl.java:218)
    at com.google.apphosting.runtime.ApiProxyImpl.access$000(ApiProxyImpl.java:68)
    at com.google.apphosting.runtime.ApiProxyImpl$1.run(ApiProxyImpl.java:182)
    at com.google.apphosting.runtime.ApiProxyImpl$1.run(ApiProxyImpl.java:180)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.google.apphosting.runtime.ApiProxyImpl.makeSyncCall(ApiProxyImpl.java:180)
    at com.google.apphosting.runtime.ApiProxyImpl.makeSyncCall(ApiProxyImpl.java:68)
    at com.google.appengine.tools.appstats.Recorder.makeSyncCall(Recorder.java:323)
    at com.googlecode.objectify.cache.TriggerFutureHook.makeSyncCall(TriggerFutureHook.java:154)
    at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:105)
    at com.google.appengine.api.taskqueue.QueueApiHelper.makeSyncCall(QueueApiHelper.java:44)
    at com.google.appengine.api.taskqueue.QueueImpl.leaseTasksInternal(QueueImpl.java:709)
    at com.google.appengine.api.taskqueue.QueueImpl.leaseTasks(QueueImpl.java:731)
    at uk.org.jaggard.myapp.BlahBlahBlahRunnable.run(BlahBlahBlahRunnable.java:53)
    at com.google.apphosting.runtime.ApiProxyImpl$CurrentRequestThreadFactory$1$1.run(ApiProxyImpl.java:997)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.google.apphosting.runtime.ApiProxyImpl$CurrentRequestThreadFactory$1.run(ApiProxyImpl.java:994)
    at java.lang.Thread.run(Thread.java:679)
    at com.google.apphosting.runtime.ApiProxyImpl$CurrentRequestThreadFactory$2$1.run(ApiProxyImpl.java:1031)
mjaggard
  • 2,389
  • 1
  • 23
  • 45

1 Answers1

0

I suspect the warnings in your application's logs will contain "Thread was interrupted, throwing CancelledException." Java's InterruptedException is discussed in http://www.ibm.com/developerworks/java/library/j-jtp05236/index.html and the book "Java Concurrency in Practice".

Eric Willigers
  • 1,710
  • 14
  • 9
  • Although I do not receive an `InterruptedException` and have no warnings about it, you are correct that this is the problem because I get an `InterruptedException` on the Dev server. However this doesn't answer the question - why is Google App Engine throwing this exception on every call to `leaseTasks`? – mjaggard Jun 26 '12 at 09:58