Last modified: 2014-05-23 21:15:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T43090, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41090 - upgradeRow() constantly triggered for invalid SVG and DjVu files
upgradeRow() constantly triggered for invalid SVG and DjVu files
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
1.21.x
All All
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
: performance
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-17 00:24 UTC by Tim Starling
Modified: 2014-05-23 21:15 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tim Starling 2012-10-17 00:24:26 UTC
MediaHandler::isMetadataInvalid() should return METADATA_BAD only when there is something wrong with the metadata, not when there is something wrong with the file. A file validation error should never cause isMetadataValid() to return false, since this causes upgradeRow() to be called every time the image is used in any way.

The SVG and DjVu handlers get this wrong. This causes high DB master load, and also errors such as bug 27639.

I would humbly point to OggHandler as a possible model for appropriate handling of invalid files: an invalid file causes an error message to be saved into the metadata array, and then getLongDesc() is overridden to display the error message to the user on the image description page. getWidth() etc. returns zero for an invalid file.
Comment 1 Aaron Schulz 2012-11-26 21:58:56 UTC
https://gerrit.wikimedia.org/r/#/c/35301/
Comment 2 Andre Klapper 2013-07-23 09:02:00 UTC
Tim: 
Aaron's patch ("Store "bad metadata" placeholder metadata for SVGs") got merged in November 2012 - did this solve the problem, or is there more to do?
Comment 3 Aaron Schulz 2013-11-23 00:42:51 UTC
There is still DjVu
Comment 4 Gerrit Notification Bot 2014-05-23 00:01:31 UTC
Change 134976 had a related patch set uploaded by Brian Wolff:
Make sure DjVu files do not attempt metadata extraction repeatedly

https://gerrit.wikimedia.org/r/134976
Comment 5 Bawolff (Brian Wolff) 2014-05-23 00:01:47 UTC
Doesn't really look like this is actually much of an issue though:

MariaDB [commonswiki_p]> select count(*) from image where img_major_mime = 'image' and img_minor_mime = 'vnd.djvu' and img_media_type= 'BITMAP' and img_metadata in ( '', '0', 'a:0:{}' );
+----------+
| count(*) |
+----------+
|        0 |
+----------+
Comment 6 Gerrit Notification Bot 2014-05-23 20:41:50 UTC
Change 134976 merged by jenkins-bot:
Make sure DjVu files do not attempt metadata extraction repeatedly

https://gerrit.wikimedia.org/r/134976

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links