objectcache: cleanup tombstone/mutex logic in doGetWithSetCallback()
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 13 Feb 2019 18:54:39 +0000 (10:54 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 13 Feb 2019 22:57:38 +0000 (22:57 +0000)
commitfdb00bf4e2d26f281b1e16437db12d407b0b6ce4
tree01ac5750e1e7b3ad5b2556364932d63a5fb6834b
parent7099937b42cdf52948ae0c3c5f761ca573f7e530
objectcache: cleanup tombstone/mutex logic in doGetWithSetCallback()

This largely follows-up 6b2f13b055c84d.

* Make the comments and use of temporary variables easier to follow.
* Simplified some conditionals by remove redundant checks.
* Bypass the final set() call if $isTombstone is true. It will almost
  always be rejected due to the tombstone still being there anyway, so
  there is no point in the roundtrips. Also, the most likely case where
  it would succeed is due to the callback taking a long time to run, in
  which case data from the replication lag uncertainty period that the
  tombstone represents would be getting saved to cache with the full
  nominal TTL, which is wrong.

Change-Id: Ic28e15b24f39e128bd72ad4d905edb852bc907aa
includes/libs/objectcache/WANObjectCache.php