title: Django with Celery - existing object not found
body: <p>I am having problem with executing celery task from another celery task.</p>
  
  <p>Here is the problematic snippet (data object already exists in database, its attributes are just updated inside finalize_data function):</p>
  
  <pre><code>def finalize_data(data):
      data = update_statistics(data)
      data.save()
      from apps.datas.tasks import optimize_data
      optimize_data.delay(data.pk)
  
  @shared_task
  def optimize_data(data_pk):
      data = Data.objects.get(pk=data_pk)
      #Do something with data
  </code></pre>
  
  <p>Get call in optimize_data function fails with "Data matching query does not exist."</p>
  
  <p>If I call the retrieve by pk function in finalize_data function it works fine. It also works fine if I delay the celery task call for some time.</p>
  
  <p>This line:</p>
  
  <pre><code>optimize_data.apply_async((data.pk,), countdown=10)
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>optimize_data.delay(data.pk)
  </code></pre>
  
  <p>works fine. But I don't want to use hacks in my code. Is it possible that .save() call is asynchronously blocking access to that row/object?</p>