Automatic photo-email assignment on photo upload doesn't work

Bug #1041720 reported by François Marier on 2012-08-26
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Libravatar (obsolete)
Fix Released
François Marier

Bug Description

Steps to reproduce:

1- pick an email that's not used by any account
2- login using Persona (which will auto-create an account)
3- upload a photo

At this stage, the photo looks like it's associated with that email address. In fact, it is in the database.

However, on disk, the photo isn't associated to the email hash.

François Marier (fmarier) wrote :

I think that this is due to a race condition:

1- photo is uploaded but isn't optimized yet
2- photo is assigned to the email
3- we attempt to create a hardlink from the photo in user/ to the email hash in avatar/
4- the photo is optimized and moved to user/ after the hardlink creation failed

So one easy fix for this would be to switch to symlink.

This would also have the advantage of reducing the amount of data rsynced to the mirrors and would make it easy to fix bug #769764.

François Marier (fmarier) wrote :

A hotfix disabling the offending feature has been made on production.

I'm now looking through the 39 photos uploaded between 2012-08-05T11:15 and 2012-08-26T18:30 UTC to make sure that the emails/openids they are associated with are working.

François Marier (fmarier) wrote :

Of these 39 photos, only 9 were affected by this problem.

They have all been fixed manually.

François Marier (fmarier) wrote :

This is now temporarily disabled on master (until the move to symlinks is done).

Changed in libravatar:
importance: High → Medium
François Marier (fmarier) wrote :

There is another way to do this without having to switch to symlinks: pass a list of hardlinks to create after the photo is cropped

That way, the worker that does the cropping can kick off changephoto jobs after the photo transformation jobs are done.

Changed in libravatar:
status: Confirmed → In Progress
Changed in libravatar:
status: In Progress → Fix Committed
Changed in libravatar:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers