When attempting to delete or cancel a user account that has 100% completion or heavy enrollment data, the operation fails with a 504 Gateway Timeout or a database Lock wait timeout exceeded.
This does not happen for unenrolled users because they have no group_content records, allowing the user deletion to pass smoothly.
Detailed Cause
When an enrolled user is deleted, Drupal deletes their Group memberships.
In Opigno, deleting a primary Learning Path membership triggers a cascading deletion of nested course memberships, module memberships, and related user stats/achievements.
This cascade loops through multiple GroupContent::postDelete() invocations.
Inside this loop, Opigno triggers sequential $user->save() attempts on the same user entity inside a single, Uncommitted, long-running database transaction.
This self-inflicted concurrent update locks the user row.
Concurrent requests or retries hit the database lock wait timeout, the proxy limit is breached, and the server throws a 504.
Comments