Page MenuHomePhabricator

Check ParserOutput validity after deserialization
Closed, ResolvedPublic

Description

Switching ParserCache serialization to JSON frees our hands for modifying ParserCache entries. For Wikimedia sites, we can simply wait for the parser cache to expire before we make structural changes to ParserOutput. However, when 3rd parties updated from an older version of MediaWiki, they will have old serialized data in the cache. Attempting to read such old serialized objects may result in partially initialized and invalid ParserOutput (and CacheTime) instances. We need a self-test method to ensure such instances are safe to use.

We could alternatively simply discard all non-json serialized cache entries, but that would create a cold cache situation, which may lead to a stampede on a busy site.

Event Timeline

Change 632573 had a related patch set uploaded (by Ppchelko; owner: Daniel Kinzler):
[mediawiki/core@master] Add test infa for ParserCache serialization/deserialization

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

Change 632964 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Add deserialization acceptance tests for ParserOutput

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

Change 632573 merged by jenkins-bot:
[mediawiki/core@master] Add test infra for ParserCache serialization/deserialization

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

Change 632964 merged by jenkins-bot:
[mediawiki/core@master] Add deserialization acceptance tests for ParserOutput

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