Skip to content
This repository was archived by the owner on Sep 11, 2026. It is now read-only.
This repository was archived by the owner on Sep 11, 2026. It is now read-only.

Race condition on ProcessedImage's TaskEventMixin with ManyToManyField #647

Description

@banesullivan

There's a flaky error happening when POSTing a ProcessedImage where the save event that triggers the task event is called, seemingly before the ManyToManyField is populated.

To my understanding, you have to save the model before populating the ManyToManyField and thus a race condition of sorts happens where the task checks for the needed source image in _processed_image_helper(). This is flaky as the refresh_from_db() call sometimes gets it in time, but sometimes does not:

https://github.com/ResonantGeoData/ResonantGeoData/blob/78065e2d44c27e2715a47028a33c3eae89ebca71/django-rgd-imagery/rgd_imagery/tasks/subsample.py#L27

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions