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

SatelliteFetching is created too late in image download process #513

Open
mvandenburgh opened this issue Sep 30, 2024 · 0 comments · May be fixed by #514
Open

SatelliteFetching is created too late in image download process #513

mvandenburgh opened this issue Sep 30, 2024 · 0 comments · May be fixed by #514

Comments

@mvandenburgh
Copy link
Member

mvandenburgh commented Sep 30, 2024

Currently when a user kicks off an image download (for either a single site, or an entire model run), the endpoint simply places a message on the queue for the celery worker to pick up. Then, the celery worker creates a SatelliteFetching row once the task starts to signal that the image generation is running. This results in a race condition where, if the celery worker is preoccupied with another task or not up, the SatelliteFetching row will not be created. This means the UI will not update to let the user know the imagery task has started.

The easiest way to observe this is to run the app locally, stop your celery worker, and then kick off an image fetch task. Notice, the UI does not update or indicate anything is happening.

I can think of two ways to fix this -

  1. Add a PENDING status to the SatelliteFetching model and set it in the endpoint prior to dispatching the task. Once the task begins, set it to RUNNING.
  2. Just create the SatelliteFetching row in the endpoint with a status of RUNNING prior to dispatching the task.

I think option 2 makes more sense. Not only is it simpler to implement, but I don't see any value in distinguishing between a PENDING and RUNNING task in the UI. Either way the user is waiting, so it doesn't seem like it would offer any useful information.

@mvandenburgh mvandenburgh linked a pull request Oct 1, 2024 that will close this issue
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 a pull request may close this issue.

1 participant