获取错误租赁任务

时间:2012-06-25 09:57:41

标签: java google-app-engine stack-trace task-queue

当我尝试从我的应用程序中的拉取队列中租用任务时,我收到以下错误。以前我的代码没有发生这种情况,因此发生了变化。我怀疑这是一个线程问题 - 这些调用是在一个单独的线程中进行的(使用ThreadManager.createThreadForCurrentRequest创建的) - 最近是否被禁止?

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)

1 个答案:

答案 0 :(得分:0)

我怀疑应用程序日志中的警告将包含 “线程被中断,抛出了CancelledException。” Java的InterruptedException在下面讨论 http://www.ibm.com/developerworks/java/library/j-jtp05236/index.html 和“Java Concurrency in Practice”一书。