Ticket #13823 (new Bug)

Opened 2 years ago

Hang with 100% CPU when accessing a portlet NamedBlobImage that doesn't exist

Reported by: danielm Owned by:
Priority: minor Milestone: 4.x
Component: Unknown Version: 4.3
Keywords: Cc:

Description

We have a portlet with an attached image that looks like this (some unrelated fields snipped):

class IHomepageFeature(IPortletDataProvider, IImageScaleTraversable):
    image_title = schema.TextLine(title=_('Image Title'), required=True)
    image = NamedBlobImage(title=_('Image'), required=True)

The URL for this image looks something like this:  http://oursite.com/Plone/++contextportlets++oursite.admintheme.homepage_feature/club-and-members/@@images/uuid-here

When uuid-here is any value that doesn't exist in AnnotationStorage for the context, a NotFound exception is raised by plone.namedfile.scaling.ImageScaling.publishTraverse(). I believe the hang is happening when an error page is being rendered; I'm having trouble tracing through the many, many layers of Zope that the exception passes through, but I have got as far as ZPublisher.Publish.publish, where it appears to be handling the error. parents is set to [<Products.Five.metaclass.ImageScaling object at 0x93aae10>], and if I change parents to None in pdb and let it continue it displays the error page as expected rather than hanging, so I'm thinking it's something to do with that.

I realise that this is a very obscure error, and I will endeavour to find the cause of it, but I am filing this ticket in the hopes that someone will have some ideas or some pointers to help.

Note: See TracTickets for help on using tickets.