Commit graph

128 commits

Author SHA1 Message Date
umherirrender
24bfde2710 Fix spacing and break some lines
Change-Id: Ia57685d8858e02e399ad5c75ce64d12609d340ac
2013-08-24 17:06:25 +02:00
jeroendedauw
9104af80ef Fix return types in documentation
Change-Id: I726e6201a737ab406dd0e46754d2bbbd95e769b4
2013-06-28 23:48:31 +02:00
asher
dcf080c16d support setting Memcached::OPT_SERVER_FAILURE_LIMIT, Memcached::OPT_RETRY_TIMEOUT
Change-Id: Ib1fcae92b65e8fd23baee7af7ed64abd908b600e
2013-06-12 12:49:38 -07:00
csteipp
d02b5bd7f7 Add value to add() call when locking
When BagOStuff::lock() was called, it called $this->add() with only
two parameters, the key and the timeout. But BagOStuff::add() takes
three parameters (key, value, timeout), so all locks got an infinite
timeout.

Change-Id: I82bed11b0b799f2cda13a8a0bd0cd94908b6ce8e
2013-05-10 12:42:16 -07:00
umherirrender
6f79eef473 Fixed spacing around parenthesis in includes
Change-Id: Ie8adc00f4ee8ecec4554e584c18d5d2073415397
2013-04-28 15:50:07 +00:00
Matthias Mullie
edf169b448 Docs for Redis' ->exec() return value
I had to look up exactly why it'd return an array, figured someone else some day
might too

Change-Id: Iefb3a0f8292baf8846ed6a1b852432eb9daa92c2
2013-04-24 10:00:02 +02:00
Aaron Schulz
9157649022 Fixed return value for RedisBagOStuff::cas().
Change-Id: I3b180baaba8fb12ab2960e358c8b6d1a1eac05dd
2013-04-23 14:31:52 -07:00
umherirrender
892ee7a4af Fixed spacing in db/debug/diff/externalstore/objectcache folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I32a43c547630ce31b6b25cc1bc9eedc50e67b2d7
2013-04-20 22:28:52 +02:00
umherirrender
15abcf71ca Added/Removed spaces around string concatenation
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !

Fixed windows newline style

Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
2013-04-13 13:36:24 +02:00
Tim Starling
9407284253 In SqlBagOStuff::getMulti(), catch connect errors
This case was somehow neglected in Ifba0d276. The other methods work
correctly.

Change-Id: If29f0212f07c13bd72469c580bb096a2a41a96b5
2013-04-03 09:56:42 +11:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
Yuri Astrakhan
9506e3d812 Spellchecked /includes directory
* Ran spell-checker over code comments in /includes/
* A few spellchecking fixes for wfDebug() calls

Found one very strange (NOOP?) line in Linker.php - see "TODO: BUG?"

Change-Id: Ibb86b51073b980eda9ecce2cf0b8dd33f058adbf
2013-03-13 03:42:41 -04:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
Reedy
c3e4057e06 Kill off numerous unused variables
Change-Id: I7039f1328f37ee669b694f73ee282602186bffd1
2013-03-08 02:36:24 +00:00
Matthias Mullie
01c1a11625 Docs for gerrit 47419
Change-Id: I021b7250418e60397127e1778107ee3da77ffb18
2013-03-07 18:54:12 +01:00
jenkins-bot
ba940af288 Merge "Read full memcached response before manipulating data" 2013-03-07 17:34:05 +00:00
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
Matthias Mullie
a8f00e5c97 Read full memcached response before manipulating data
Memcached response when fetching data typically looks like this:
VALUE <the stored value for whatever key you requested>
END

What the code used to do is read the first line (the VALUE) and re-
assemble the data being fetched there (like unserializing serialized
data). After that, it will read the next line (END).

The value could be a serialized object, which could have a __wakeup.
This __wakeup could have code which in turn executes Memcached-
related stuff. The problem is that, while that object is being
unserialized already, it's wakeup code is attempting to read new
stuff from Memcached, but we have yet to read the END of the data
we're attempting to unserialize (when we'll read a new value from
Memcached, the first thing we'd get is the END we have not yet read..)

The correct way to go about this would be to first read the full
Memcached response, and only unserialize the read data after that.
This is exactly what this patchset does.

Change-Id: I902809c6dde657091c8161a09df823170bd41f7a
2013-03-07 15:59:10 +01:00
Siebrand Mazeland
9b7889b84b Use American English spelling for behavior
Spotted in ipbreason-dropdown by Shirayuki.

Change-Id: I576ed4bc0abe5ab980aaee3fb9f9e4b43087311f
2013-03-04 10:24:57 +01:00
Reedy
b3e34e3c46 Add missing parameter in handleWriteError call
Change-Id: If3ebf6f77d66121bac8e11d43582f1dbb3e88e12
2013-02-27 09:48:32 +00:00
Aaron Schulz
36e186aa03 [BagOStuff] Converted RedisBagOStuff to RedisConnectionPool.
Change-Id: I9c269b77e51d335702146d15ebbfd38167c4ed1d
2013-02-26 20:45:13 +00:00
Aaron Schulz
0b442a82e8 [BagOStuff] De-breakified cas() for SqlBagOStuff.
* Seemed to be a functional merge conflict with sharding code.

Change-Id: I1e49790f6b82b09ea2cd6606ca918f0a620a191f
2013-02-15 14:31:19 +00:00
umherirrender
ca31ebad3f fix some spacing
Added/removed spaces after opening/before closing parentheses

Added a space after a comma

Removed unneeded parentheses in condition

Change-Id: I306091347ccaaf11dee0cdfda3019cb0c12be51b
2013-02-09 23:03:53 +01:00
umherirrender
48cd72819e fix some spacing
Change-Id: Ia9650be8b791fd2f0ccbc099436918a9d12d9968
2013-02-04 20:04:26 +00:00
Antoine Musso
f6b92231fd style: normalize end of files
By PSR2 PHP Standard, the files should ends with exactly one newline.
Some of our files have 2 or more and some other were missing a newline.

Fix almost all occurences of CodeSniffer sniff:
PSR2.Files.EndFileNewline.TooMany

I have not fixed the selenium files, I believe we will drop them.

Change-Id: I89fca8c1786fee94855b7b77bb0f364001ee84b6
2013-02-03 15:04:39 +01:00
Aaron Schulz
e2e6b16123 Improved BagOStuff docs.
Change-Id: I01c62de23b73e1bac96aede73cd6995df8ff1221
2013-01-25 11:50:02 -08:00
Brent Garber
0072e0efeb (bug 44024) ObjectCache changes break XCache 3.x support
Changes in the 1.20.x branch altered the add method to check for the return value of get against
false.  Xcache 3.x returns NULL for unset values and so this check was erroneously determining that
all values are set when they were not.

This was causing basic ObjectCache usage to fail.

Change-Id: I0975e5c6a60c2813dc2d02aca84245807b8fb828
2013-01-19 03:43:03 +00:00
Alexandre Emsenhuber
b1f8855078 Follow-up Id75401be (e32c8afe): no more need to prefix debug messages
Since that revision, messages sent through wfDebugLog() and without
a corresponding entry in $wgDebugLogGroups will be prefixed there
before being sent to wfDebug(), so it's no longer needed to have the
exact same checks for the debug messages in memcached clients.

Change-Id: Ia690a87bc6d1994fe371816470efde6d09e3b881
2013-01-16 20:08:16 +01:00
Demon
0e5f53d262 Merge "Removed useless keys() function from BagOStuff." 2013-01-14 11:48:31 +00:00
Platonides
671bb97746 Add wfProfileOut() missing in 74f581e34
Change-Id: Icc567e3f27dc8f9d0e405fcb9fa1103d9012acb3
2013-01-13 18:01:40 +01:00
Matthias Mullie
74f581e348 Added merge() function to BagOStuff for CAS-like functionality.
* merge() will use CAS if supported or use locking otherwise
* The lock()/unlock() methods now have a default implementation
* added unit tests for merge

Change-Id: Ic27088488f8532f149cb4b36e156516f22880134
2013-01-10 09:03:09 +01:00
Aaron Schulz
692e6103f2 Removed useless keys() function from BagOStuff.
Change-Id: Ie4249b2770de81377019ad383039ab85c0c5de7a
2013-01-07 17:32:27 -08:00
Tim Starling
7c4198805a Use consistent hashing for SqlBagOStuff servers
Also factor out consistent hash code from Redis and the new application
into a class called ArrayUtils. The name "ArrayUtils" is from
I0f4e7d7c, I expect that change will be rebased on top of this one at
some point.

Change-Id: I9375087f4d7a6e8e629d97bfb6b117d9cb7d1bcf
2013-01-04 18:07:07 +00:00
Tim Starling
30d6510f63 Multiple servers in one SqlBagOStuff
Added a multi-server feature to SqlBagOStuff.

Tests done:
* With both the "shard" and multi-server features enabled and
  $wgAllDBsAreLocalhost, tested getMulti, set, incr, decr, keys,
  garbageCollect, deleteAll. Tested wiki page views with
  $wgMainCacheType set to such a cache.
* Tested connection errors.
* In the plain CACHE_DB configuration, tested wiki page views.

Change-Id: Ifba0d276ef724cc9b33f687bc0adae4637054328
2012-12-28 19:13:21 +11:00
Reedy
d537d96868 Add numerous missing @throws to method documentation
Change-Id: Iba868e82a75fef7c7d011bc5be192bf059d037c0
2012-12-09 03:09:48 +00:00
Ori Livneh
8c313fe58b Fix typo: exipration => expiration
Change-Id: I73d19cfeed0596b66e16e4c383b3658594c211e3
2012-11-15 01:47:54 -08:00
Niklas Laxström
ac7e23b553 Typofix
Change-Id: I50bf84c3d7f75f6d2a0f3d4f8e86622486f2be28
2012-11-14 07:43:02 +00:00
Aaron Schulz
efda0b27be Added GET profiling to pecl memcached (like the PHP one has).
Change-Id: Ic92eb740240e2cb46688a174cdeda87c02d4d498
2012-11-07 13:42:40 -08:00
Aaron Schulz
29ab088e2f Merge "Stop php strict error warnings from MemcachedClient::_flush_read_buffer()" 2012-10-23 18:44:48 +00:00
umherirrender
c66d868e6d Remove a bunch of trailing spaces and unneeded newlines
Change-Id: I166a171c196f4c2c75886be12f913ffa9a4a35ad
2012-10-19 22:10:42 +02:00
awjrichards
b7a9b77199 Stop php strict error warnings from MemcachedClient::_flush_read_buffer()
Change-Id: I467f293e3be30c7019111a368491c1a3a6a2af08
2012-10-12 11:46:41 -07:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
Tim Starling
6a1a1698a5 Rationale for using MD5 hash
Just documenting some benchmark work I did.

Change-Id: Ic24edc5b857e06a8bfe83d70f2da0d7f4690c6af
2012-09-19 18:35:42 +02:00
Aaron Schulz
5c164069a3 Fixed warning spam in SqlBagOStuff.
Change-Id: Iac573980596349deab757eac859d9e28dc2963b6
2012-09-16 10:56:52 -07:00
IAlex
b8256e78fb Merge "Made DBABagOStuff return values match the base class better." 2012-09-08 05:46:50 +00:00
Aaron
feda536915 Made DBABagOStuff return values match the base class better.
Change-Id: I2e6fd79195c52e66f8345c5cc67c2e3dcc04578d
2012-09-05 12:50:09 -07:00
Aaron
676446ef90 Made default BagOStuff::incr() function more like memcached.
Change-Id: Ia216f20fdcf855448e2f2e4d99667e72c6254f82
2012-09-05 11:51:04 -07:00
Alexandre Emsenhuber
a75b6d53cd Improve documentation of maintenance scripts.
Also contains a fix for Ia5a38311 (fae0550).

Change-Id: I630c83b48b66c5d8c97411082cabd731f316f42d
2012-09-02 20:33:22 +02:00
Alexandre Emsenhuber
d3e0168c67 Added missing GPLv2 headers in new files.
Also improved file documentation.

Change-Id: Ia5a383110769cf51603305dc639616d904ebbab2
2012-09-01 21:56:38 +02:00
Vitaliy Filippov
359d2fd2f9 Bug 20595 - Fixed incr()/decr() functions for some caches.
* Preserve TTL in objectcache incr() method for APC, XCache and DBA.
  Do not serialize numeric values, since it breaks the counters.
* Also gave some DBABagOStuff functions explicit visibility.

Change-Id: I13856832f418c843afc8e42a6d77686331f6cb41
2012-08-29 18:35:24 -07:00