Skip to content

Fix issue where group syncs process before database transaction completes

Basraah requested to merge basraah:group-sync-race into master

Fixes a timing issue where celery workers may process group sync functions before the database transaction has completed. This was resulting in the sync function querying the users old groups rather than the just updated groups.

Depending on the number of workers an installation is running, the number of group sync functions affected may vary from one to, potentially, all of them. In my testing, typically by the time the second sync function is called by the celery worker the transaction has completed and the query data is correct.

This fix forces the groups changed receiver to wait until the transaction complete signal is received before calling the celery group sync functions.

Merge request reports