title: Celery task STARTED permanantly (not retried)
body: <p>We use a celery worker in a docker instance.  If the docker instance is killed (docker could be changed and brought back up) we need to retry the task.  My task currently looks like this:</p>
  
  <pre><code>@app.task(bind=True, max_retries=3, default_retry_delay=5, task_acks_late=True)
  def build(self, config, import_data):
      build_chain = chain(
          build_dataset_docstore.s(config, import_data),
          build_index.s(),
          assemble_bundle.s()
      ).on_error(handle_chain_error.s())
  
      return build_chain
  
  @app.task(bind=True, max_retries=3, default_retry_delay=5, task_acks_late=True)
  def build_dataset_docstore(self, config, import_data):
      # do lots of stuff
  
  @app.task(bind=True, max_retries=3, default_retry_delay=5, task_acks_late=True)
  def build_index(self, config, import_data):
      # do lots of stuff
  
  @app.task(bind=True, max_retries=3, default_retry_delay=5, task_acks_late=True)
  def assemble_bundle(self, config, import_data):
      # do lots of stuff
  </code></pre>
  
  <p>To imitate the container being restarted (worker being killed) I'm running the following script:</p>
  
  <pre><code>SLEEP_FOR=1
  
  echo "-&gt; Killing worker"
  docker-compose-f docker/docker-compose-dev.yml kill worker
  
  echo "-&gt; Waiting $SLEEP_FOR seconds"
  sleep $SLEEP_FOR
  
  echo "-&gt; Bringing worker back to life"
  docker-compose-f docker/docker-compose-dev.yml start worker
  </code></pre>
  
  <p>Looking in flower i see the task is STARTED... cool, but...</p>
  
  <ul>
  <li>why isnt it retried?</li>
  <li>Do i need to handle this circumstance manually?</li>
  <li>if so, what is the correct way to do this?</li>
  </ul>
  
  <p>EDIT:
  from the docs:</p>
  
  <blockquote>
    <p>If the worker won’t shutdown after considerate time, for being stuck in an infinite-loop or similar, you can use the KILL signal to force terminate the worker: but be aware that currently executing tasks will be lost (i.e., unless the tasks have the acks_late option set).</p>
  </blockquote>
  
  <p>I'm using the acks late option, so why isn't this retrying?</p>