Issue 1:
Checklist

I have checked the issues list

for similar or identical enhancement to an existing feature.

I have checked the pull requests list

for existing proposed enhancements.

I have checked the commit log

to find out if the if the same enhancement was already implemented in the

master branch.

I have included all related issues and possible duplicate issues in this issue

(If there are none, check this box anyway).

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Brief Summary

I have a form in my Django app which creates an object car (it does not matter that I use Django, it's just to explain the main idea). I use celery to run operations, once new object car was created (by using post_save signal). I have an option to delete the car. So it should delete it from the database and it should run deleting operations with Celery. I use pre_save for that.

The problem is as following: The creating operations can take some time (a few minutes). This means, that user can create a new car and while running the Celery creation operation, he will ask to delete the object. The celery tasks:

@app.task(bind=True)
def create_car(self, car_pk):
from cars.models import car
if car_pk is None or not isinstance(car_pk,int):
return False
car_obj = car.objects.get(pk=car_pk)

# Creation operations

car_obj.save()
return creation_status

@app.task(bind=True)
def delete_car(self, car_pk):
from cars.models import car
if car_pk is None or not isinstance(car_pk,int):
return False
car_obj = car.objects.get(pk=car_pk)

# deletion operations

return deletion_status

So my question is - how should I handle this case? Can I somehow "stop" the creation task? Or can I somehow "wait" until the creation task finish and then do the deletion operations?

If both cases can be achieved, I would be glad to see them both.

Design

Architectural Considerations

None

Proposed Behavior

Proposed UI/UX

Diagrams

N/A

Alternatives

None

Issue 2:
Checklist

[ x] I have verified that the issue exists against the master branch of Celery.

This has already been asked to the discussion group first.

[ x] I have read the relevant section in the

contribution guide

on reporting bugs.

[ x] I have checked the issues list

for similar or identical bug reports.

[ x] I have checked the pull requests list

for existing proposed fixes.

[ x] I have checked the commit log

to find out if the bug was already fixed in the master branch.

[ x] I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Mandatory Debugging Information

[x ] I have included the output of celery -A proj report in the issue.

(if you are not able to do this, then at least specify the Celery

version affected).

[ x] I have verified that the issue exists against the master branch of Celery.

I have included the contents of pip freeze in the issue.

[ x] I have included all the versions of all the external dependencies required

to reproduce this bug.

Optional Debugging Information

[x ] I have tried reproducing the issue on more than one Python version

and/or implementation.

[ x] I have tried reproducing the issue on more than one message broker and/or

result backend.

[x ] I have tried reproducing the issue on more than one version of the message

broker and/or result backend.

I have tried reproducing the issue on more than one operating system.

[ x] I have tried reproducing the issue on more than one workers pool.

I have tried reproducing the issue with autoscaling, retries,

ETA/Countdown & rate limits disabled.

I have tried reproducing the issue after downgrading

and/or upgrading Celery and its dependencies.

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Environment & Settings

Celery version: celery 4.4.7

celery report Output:

No output.

Steps to Reproduce

Required Dependencies

Minimal Python Version: python 3.8

Minimal Celery Version: celery 4.4.7

Minimal Kombu Version: N/A or Unknown

Minimal Broker Version: N/A or Unknown

Minimal Result Backend Version: N/A or Unknown

Minimal OS and/or Kernel Version: N/A or Unknown

Minimal Broker Client Version: N/A or Unknown

Minimal Result Backend Client Version: N/A or Unknown

Python Packages

pip freeze Output:

Other Dependencies

N/A

Minimally Reproducible Test Case

Expected Behavior

I expect this line of code `fs = s3fs.S3FileSystem(anon=True)` to work, but whenever it reaches this stage celery hangs.

Actual Behavior

Nothing Happens.