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.
ProcessedImage's TaskEventMixin with ManyToManyField #647
There's a flaky error happening when POSTing a
ProcessedImagewhere the save event that triggers the task event is called, seemingly before theManyToManyFieldis populated.To my understanding, you have to save the model before populating the
ManyToManyFieldand thus a race condition of sorts happens where the task checks for the needed source image in_processed_image_helper(). This is flaky as therefresh_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