Skip to content

SatelliteFetching is created too late in image download process #513

@mvandenburgh

Description

@mvandenburgh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions