Race condition in the dynamic resizer
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Libravatar (obsolete) |
Triaged
|
High
|
Unassigned |
Bug Description
Traceback (most recent call last):
File "/usr/lib/
response = callback(request, *callback_args, **callback_kwargs)
File "/usr/share/
(resized_
File "/usr/share/
resized_img = Image.open(
File "/usr/lib/
raise IOError("cannot identify image file")
IOError: cannot identify image file
It looks like what is happening is that the resized_avatar() function queues up a resize job and then immediately tries to open the image without waiting for it to exist:
# If the resized avatar already exists, don't re-generate it
if not os.path.
gm_client = libgearman.Client()
for server in settings.
workload = {'email_hash': email_hash, 'size': size}
resized_img = Image.open(
We need to find a way to make that gm_client.do() call block until it's done, or not use gearman here.
> We need to find a way to make that gm_client.do() call block until it's done
Now that bug 1532640 is fixed, this should be fairly easy since the python-gearman API is much better:
https:/ /pythonhosted. org/gearman/ client. html