Deadline exceed error in task queue with Basic module (Google app engine)

522 views Asked by At

I'm using python Google App engine SDK and Django framework. In my case, the task queue is throwing deadline exceed error

DeadlineExceededError: The overall deadline for responding to the HTTP request was exceeded.

though using task queue in basic scaling and as per doc task in basic or manual scaling can run up to 24 hours.

Task is updating all MySQL DB values so is time-consuming.

Initiating a task by sending post request in

@api_view(['POST'])
def post_url(request):
 params= dict(.......)#some dict
 taskqueue.add(url='/tasks/gcm/gcm_all_user/',
                          params=params,
                          method="POST")
 return Response('Initiated task')

this task is dispatched to basic scaling module by dispatch.yaml

dispatch:
- url: "*/tasks/*"
  module: tasks

the task module have a handler for url

application: some-application
module: tasks
version: 2
runtime: python27
api_version: 1
threadsafe: true
basic_scaling:

libraries:
- name: MySQLdb
  version: "latest"

handlers:
- url: /tasks.*
  script: app.wsgi.application

Kindly could anyone tell how to make task run for longer without deadline exceed error.

1

There are 1 answers

0
Andrei Volgin On

The task can run for as long as you need it, but HTTP requests have their own deadlines. You may need to refactor the code that runs within your task - possibly, breaking one large request into a series of smaller requests.