From: Aaron Schulz Date: Tue, 10 Jul 2018 20:44:24 +0000 (+0100) Subject: objectcache: minor fix to MultiWriteBagOStuff::doWrite() X-Git-Tag: 1.34.0-rc.0~4752^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=32d8dd04f09f4c031dbb9db99d8ed5fc6b8a0ad6;p=lhc%2Fweb%2Fwiklou.git objectcache: minor fix to MultiWriteBagOStuff::doWrite() For the case of add(), any non-zero index can have async writes Bug: T198239 Change-Id: I95f63143dcb894b9d12859c221f7d8e72fdf076f --- diff --git a/includes/libs/objectcache/MultiWriteBagOStuff.php b/includes/libs/objectcache/MultiWriteBagOStuff.php index fd450249b9..da1f7b35be 100644 --- a/includes/libs/objectcache/MultiWriteBagOStuff.php +++ b/includes/libs/objectcache/MultiWriteBagOStuff.php @@ -202,7 +202,7 @@ class MultiWriteBagOStuff extends BagOStuff { $ret = true; $args = array_slice( func_get_args(), 3 ); - if ( count( $indexes ) > 1 && $asyncWrites ) { + if ( array_diff( $indexes, [ 0 ] ) && $asyncWrites ) { // Deep-clone $args to prevent misbehavior when something writes an // object to the BagOStuff then modifies it afterwards, e.g. T168040. $args = unserialize( serialize( $args ) );