task-queue

appengine runs failed tasks twice even if task_retry_limit=0

烈酒焚心 提交于 2019-12-11 04:15:02
问题 I'm seeing a buggy behaviour in taskqueue API. When a task fails, appengine always runs it once again, even if I tell it not to. This is the relevant code: NO_RETRY = TaskRetryOptions(task_retry_limit=0) class EnqueueTaskDapau(webapp2.RequestHandler): def get(self): taskqueue.add( url='/task_dapau', queue_name='DEFAULT', retry_options=NO_RETRY ) class TaskDapau(webapp2.RequestHandler): def get(self): logging.warning('Vai dar pau') raise BaseException('Deu pau :-)') def post(self): return self

Behavior of singletons in task queues on app-engine

天涯浪子 提交于 2019-12-11 02:40:31
问题 What happens to my static variables when app-engine spins new instances? More specifically I am using a Task Queue that can have 40 instances/thread. Within the Servlet in question, I am using a singleton, as in public class WorkerThread extends HttpServlet { @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { .. MySingleton single = MySingleton.getInstance(); .. } ... } Here is how the singleton is created public

Simple Google App Engine Task Queue tutorial? Flask/ Python/ GAE

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 22:41:10
问题 I can't even get a task queue to fire a simple print statement. I don't know if my app structure is incorrect or not... What's the most simple example of a task queue and the structure for it? Because this isn't working for me: @app.route('/task', methods=["GET", "POST"]) def testtask(): print "Hi, I'm calling the task" taskqueue.add( url='/execute_task' ) return "I called the task" @app.route('/execute_task', methods=["GET", "POST"]) def execute_task(): print "I'm executing the task" return

Task.StartOrRestartWhenPossible

六月ゝ 毕业季﹏ 提交于 2019-12-10 19:48:26
问题 I'm attempting to use the .NET Task framework. My scenario is this: I have a task that needs to execute whenever any properties on my class change. If it was already executing, the task should bail immediately and restart such that there is only one task running at any given time. In reality, it may take a second to stop the task during which time I may receive multiple PropertyChanged events (that should only trigger one rerun of the task). And my PropertyChanged handler cannot block. With

Passing multiple parameter in app-engine Task Queue (JAVA)

回眸只為那壹抹淺笑 提交于 2019-12-10 13:08:14
问题 Is there a way to pass multiple parameters in a Queue in google-app-engine? I use the code below Queue queue = QueueFactory.getQueue("sms-queue"); queue.add(TaskOptions.Builder.url("/SQ").param("id",pId)); in my servlet this id is retrievd as a query string. long pID = Long.parseLong(req.getParameter("id")); I need to pass 6 parameters. 回答1: Have you tried doing this: queue.add(TaskOptions.Builder .url("/SQ") .param("p1Name", p1Value) .param("p2Name", p2Value) .param("p3Name", p3Value) // etc

Getting the Tasks in a Google App Engine TaskQueue

别等时光非礼了梦想. 提交于 2019-12-09 18:01:38
问题 I know you can view the currently queued and running tasks in the Dashboard or development server console. However, is there any way to get that list programmatically? The docs only describe how to add tasks to the queue, but not how to list and/or cancel them. In python please. 回答1: It sure doesn't look that way. Instead of removing the task, how about altering the task handler, whatever it is that handles the task url invokes, to check to see if the work specified still needs to be done,

Deferred Task Request deadline exceeded but work never started

无人久伴 提交于 2019-12-08 09:10:23
问题 I have a task queue that handles deferred tasks that need to be processed in real time (I have heard this isn't a good idea but can't find any supporting documentation on this.). This queue is hit with an large influx of tasks (2500/min) and then often receives nothing for a minute or two. queue.yaml - name: event-message rate: 200/s bucket_size: 200 retry_parameters: task_retry_limit: 2 min_backoff_seconds: 1 What I have noticed is that I often get "Process terminated because the request

How to Consume App Engine Task Queue Via Compute Engine Instance

送分小仙女□ 提交于 2019-12-08 07:33:38
问题 I have a Google App Engine Application with a Task Queue. I'm thoroughly confused on how to create a Compute Engine Instance that can lease tasks from the Task Queue via the Task Queue REST API. Keep in mind I am developing/testing locally right now. In my queue.yaml file, I define the following taskqueue: - name: videos mode: pull acl: - user_email: projectID-compute@developer.gserviceaccount.com - writer_email: projectID-compute@developer.gserviceaccount.com This email address is the

queue.yaml not working in App engine (development)

こ雲淡風輕ζ 提交于 2019-12-07 14:52:48
问题 I'm trying to use "queue.yaml" to define queues in a Google App Engine app (Java version). queue: - name: default rate: 5/s - name: availableTicketsAlert rate: 5/s - name: billingReminder rate: 5/s - name: cseIndexing mode: pull When I try to see if they've been created correctly in this URL: /_ah/admin/taskqueue, I only see "default" queue. Instead, If I try to create the using with the XML file all works correctly (queue.xml): <queue-entries> <queue> <name>default</name> <rate>5/s</rate> <

Why Google App Engine Tasks can spuriously be executed more than once?

会有一股神秘感。 提交于 2019-12-07 12:57:34
问题 Why Google App Engine Tasks can be executed more than once? According do Brett Slatkin talk from Google I/O 2009, it is possible for a task to spuriously run twice even without server failures! This has something to do with spurious wakeup of threads? 回答1: Brant Slatkin gave a similar talk at I/0 2010. I don't know that he ever gave details of how or when this could happen. His point was that because of the way Task Queues work it is possible by design for tasks to be reenqueued. Because of