本文介绍了App Engine日志中的/ _ah / queue / __ deferred__的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Google Cloud SQL的App Engine应用程序,并且从我的应用程序中的一个页面开始执行一些数据库操作;无论何时访问此页面,都无法执行所有数据库操作。当我进入控制台时,我看到的只是 / _ ah / queue / __ deferred __ 。

I have an App Engine application which uses Google Cloud SQL, and from a page in my application I am doing some database operation; whenever this page is accessed, it is not able to perform all database operations. When I go to the console, all I see is /_ah/queue/__deferred__.

我能够在本地主机上运行应用程序时没有任何问题,因此代码没有错误,但是,在部署Cloud SQL之后会出现问题。

I am able to run the application without any issues on localhost so code has no errors, however, there is an issue with the Cloud SQL after deploying it.

注意:我的代码中没有使用任何队列。

Note : I have not used queues anywhere in my code.

什么 / _ ah / queue / __ deferred __ 会出现在App Engine日志中的实际原因是什么?

What is the actual cause for /_ah/queue/__deferred__ to appear in App Engine logs?

推荐答案

我有类似的问题。我发现在我的一个过滤器中为每个输入连接打开会话:

I had a similar issue. I've found that that in one of my filters was opening session for each incomming connection:

httpRequest.getSession(true);
//or the one below - both opens a valid HTTP Session
httpRequest.getSession();

和我的 appengine-web.xml 配置为异步存储会话

and my appengine-web.xml was configured to store session asynchronously

<sessions-enabled>true</sessions-enabled>
<async-session-persistence enabled="true"/>

这导致在默认队列中创建大量任务,并且每个人都试图存储空会议。为了避免这种情况,请确保您只在正确的请求中打开会话。通过在您的 web.xml中修改过滤器或更改过滤器 url-patterns

This has resulted in creating a lot of tasks in default queue and each one of them tried to store an empty session. To avoid this, make sure that you are opening session only for proper requests. Either by fixing filter or changing filter url-patterns in your web.xml

这篇关于App Engine日志中的/ _ah / queue / __ deferred__的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 02:01