Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task/DES-abc: Move project asset directory deletion to celery task #118

Merged
merged 3 commits into from
Jan 23, 2023

Conversation

nathanfranklin
Copy link
Collaborator

Overview:

Moving project assets deletion to celery

PR Status:

  • Ready.

Related Jira tickets:

Testing Steps:

  1. Do a project deletion and confirm that the project is deleted and done in a celery task

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)

@nathanfranklin nathanfranklin changed the title task/ : Move project asset directory deletion to celery task task/DES-abc: Move project asset directory deletion to celery task Jan 23, 2023
Copy link
Contributor

@duckonomy duckonomy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deleting functionality works with celery! Got some comments however on some issues!

Seems like we need

from geoapi.tasks.projects import remove_project_assets

in
geoapi/tasks/__init__.py

Also, there doesn't seem to be a way the request in the welcome menu gets the response to update the waiting state. Maybe we should poll on that 🤔 ?
As of now, spinner just seems to spin until refresh page.

@duckonomy duckonomy self-requested a review January 23, 2023 19:00
Copy link
Contributor

@duckonomy duckonomy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nathanfranklin nathanfranklin merged commit db37557 into master Jan 23, 2023
@taoteg taoteg deleted the task/refactor-project-deletion branch July 6, 2023 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants