Page MenuHomePhabricator

Investigate if BacklinksCache needs to be serializable
Closed, ResolvedPublic

Description

The core class BacklinksCache currently has __sleep method with clear intention to support php serialization of its instances. However, looking at all the usages of the class, I do not see why would we want to serialize it. Serializing should only be needed if it's ever saved in a property of another serializable class, and I can't find a case like this.

  • Find usages of BacklinksCache and see if it indeed needs to be serialized. If it is, scratch the next points and think more about it
  • Create DeprecatedSerializationTrait - will emit deprecation warnings form sleep and wakeup. See NonserializableTrait for inspiration
  • Use the trait on BacklinksCache, deploy, wait one week
  • Use NonSerializableTrait on BacklinksCache.

Event Timeline

Change 714085 had a related patch set uploaded (by TChin; author: TChin):

[mediawiki/core@master] Add logger to BacklinkCache serializing

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

Change 714085 merged by jenkins-bot:

[mediawiki/core@master] Add logger to BacklinkCache serializing

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