From 32d8dd04f09f4c031dbb9db99d8ed5fc6b8a0ad6 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 10 Jul 2018 21:44:24 +0100 Subject: [PATCH] objectcache: minor fix to MultiWriteBagOStuff::doWrite() For the case of add(), any non-zero index can have async writes Bug: T198239 Change-Id: I95f63143dcb894b9d12859c221f7d8e72fdf076f --- includes/libs/objectcache/MultiWriteBagOStuff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ) ); -- 2.20.1