EBernhardson has uploaded a new change for review.

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

Change subject: Ensure a number put into memcached comes out as a number
......................................................................

Ensure a number put into memcached comes out as a number

My logs are getting spammed with:

    [resourceloader] ResourceLoaderModule::getDefinitionMtime: New definition 
for module ... in context
"..."

This is because that particular code puts an integer into the BagOStuff
and rejects any value it pulls back out that is not an integer.  This patch
updates the memcached client behind the BagOStuff to always return the
same type as it recieved.

Change-Id: Ie4dc8cf2c2cd232a2c167b4075ff4254b656bcbc
---
M includes/objectcache/MemcachedClient.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/19/194419/1

diff --git a/includes/objectcache/MemcachedClient.php 
b/includes/objectcache/MemcachedClient.php
index bc4a00b..9588aba 100644
--- a/includes/objectcache/MemcachedClient.php
+++ b/includes/objectcache/MemcachedClient.php
@@ -1027,7 +1027,9 @@
 
                $flags = 0;
 
-               if ( !is_scalar( $val ) ) {
+               // All non-strings are serialized, non-scalars are obvious, but 
even numbers must
+               // be serialized otherwise they will come out as strings, 
losing their type information
+               if ( !is_string( $val ) ) {
                        $val = serialize( $val );
                        $flags |= self::SERIALIZED;
                        if ( $this->_debug ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/194419
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie4dc8cf2c2cd232a2c167b4075ff4254b656bcbc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to