task/DES-abc: Move project asset directory deletion to celery task #118
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview:
Moving project assets deletion to celery
PR Status:
Related Jira tickets:
Testing Steps:
Notes
Background:
The deletion work from the route should be moved to celery as it can take awhile (especially with poetry pointcloud files in a project) but it seems to cause a worse problem where just 4 project deletions can block the 4 workers in gunicorn. It looks like it is something like this issue: https://www.aboutwayfair.com/tech-innovation/blocking-io-in-gunicorn-gevent-workers (in our case something in
shutil.rmtree
is blocking IO that gevent can't handle and blocks the workers 🤷♂️ ). (in addition to gunicorn docs, I found this overview helpful https://luis-sena.medium.com/gunicorn-worker-types-youre-probably-using-them-wrong-381239e13594)