Commit graph

191 commits

Author SHA1 Message Date
jenkins-bot
b0dcb13e9b Merge "Made $timeout in BagOStuff::lock() actually work" 2014-11-20 09:39:41 +00:00
Aaron Schulz
1fa3a4d678 Unbreak lock()/unlock() for MemcachedPhpBagOStuff
Change-Id: I49ce96b65fe6a6e2cba86a990962fe4efc43bbb8
2014-11-20 01:25:38 -08:00
Aaron Schulz
19f3068ce5 Made $timeout in BagOStuff::lock() actually work
* Also added a separate $expiry option for things that take a long time

Change-Id: Ie5f81dea031f3c3f3ca8d61ad4cb322a5b876f61
2014-11-20 00:26:44 -08:00
Kunal Mehta
dd8fef31e7 ObjectCacheSessionHandler::getCache() returns BagOStuff
Change-Id: I7f514857154297c7033dd26af97b6ac83c13f104
2014-11-13 12:53:50 -08:00
Sergio Santoro
807b24eb27 SqlBagOStuff: reuse code of parent class
It'll be easier to change the time threshold (currently 10 years)
in the future.

Change-Id: I24005148d40c47905d5b20cfd506decef2ae447e
2014-10-25 19:26:21 +02:00
Sergio Santoro
4c79d2e7e4 SqlBagOStuff: fix percentage in deleteObjectsExpiringBefore()
Partial deletion percentage progess was computed using
$remainingSeconds. This is incorrect since $remainingSeconds
is going to *decrease* ( instead of increase ) while the
process continues.
The correct implementation uses 'processed seconds' instead.

Change-Id: Ic745f6e8375a85da543de36703fad6d31f62ea90
2014-10-16 20:43:38 +02:00
Sergio Santoro
9ae3d27ef0 SqlBagOStuff: document public method deleteAll()
Change-Id: I23700714453b6243e564642f2bad4a2d1c2469c6
2014-10-15 22:57:53 +02:00
Reedy
f3ae6fa6cc Fix expires typo in comment
Change-Id: I4bb63f610ce0ec246c4aa7aef3d04f096fb3e564
2014-10-08 16:55:52 +01:00
Tim Starling
9f0d40e08f HashBagOStuff: use the value itself as the CAS token
Avoid an unnecessary serialize() call on get() requests, which makes it
faster and also happens to work around a nasty crash bug which is
causing lots of segfaults right now.

CAS semantics should be the same, if the caller handles a CAS token in
an opaque way and does not assume it is a string. I could only find one
caller of cas() in core and WMF deployed extensions, and that is
BagOStuff::mergeViaCas(), which does correctly handle CAS tokens of any
type.

Bug: 71724
Change-Id: I0b0b5f0157c005ec7f76210dfb8576c056314733
2014-10-07 16:29:57 +11:00
Aaron Schulz
330e18c45d Removed MultiWriteBagOStuff::replace
Change-Id: Ifa6373cda099d1b87e90592598267987e9185a25
2014-09-12 11:13:06 -07:00
Aaron Schulz
9d59d4088e Removed deprecated BagOStuff::replace() method
Change-Id: Ife2f8e0f10ad7be76b79d5aee435491ea78d4655
2014-09-12 02:03:32 -07:00
Aaron Schulz
eaf2f36483 Make sure getMulti() returns an array per the class interface
Change-Id: Ic08f3ac37467a2743d7f8be5f5fb0032f84c3b82
2014-09-03 20:17:28 +00:00
umherirrender
63dc5abc9a Fixed spacing
- Added space after reserved words: function, foreach, if
- Combined 'else if' into elseif
- Added braces to one-line statements
- Added spaces after comma, before parentheses

Change-Id: Ie5bbf680d6fbe0f0872dab2700c16b1394906a72
2014-08-27 18:31:50 +02:00
Bryan Davis
d7c8c3446d Ensure that expiry times are given as integers
Fixes "Fatal error: Argument 4 passed to Memcached::cas() must be an
instance of int, float given".

Change-Id: Ibf1ea638ec1a4dcf009cdaea8aa66008c74ff30b
2014-08-22 09:55:59 -06:00
addshore
dfd4c8c2a2 Use public instead of var in classes
Change-Id: I16d1714ba37667d8c9c7c79a765c7199ea0023e4
2014-08-17 21:07:37 +01:00
umherirrender
3b2b6a2773 Add missing @param to function docs
Change-Id: I47fa96a976f55a1a93cb75397285edb8c7f4cd8a
2014-08-14 20:22:52 +02:00
jenkins-bot
088a8bd2b4 Merge "Revert "Made LCStoreDB try to use a separate DB connection"" 2014-08-13 21:01:36 +00:00
umherirrender
21e0c1c533 Correct variable names in @param to match method declarations
Some @param have a typo in the variable name,
some @param's were in wrong order.

Change-Id: Ie25806831027112b398f6f4a909c59147ac3a5fa
2014-08-13 21:48:28 +02:00
C. Scott Ananian
9c0fff5a4b Revert "Made LCStoreDB try to use a separate DB connection"
This commit broke `php tests/parserTests.php`.

This reverts commit 4c0871fa0e.

Bug: 69082
Change-Id: If0781f8f51681717a848ec359c7b8c70932ed72d
2014-08-03 17:40:03 -04:00
jenkins-bot
627e33ed36 Merge "Cleanup some docs (includes/[m-r])" 2014-07-25 17:14:53 +00:00
jenkins-bot
9fc8b2228e Merge "Check for boolean false result from database query in SqlBagOStuff" 2014-07-25 01:31:55 +00:00
umherirrender
dd8921c9d9 Cleanup some docs (includes/[m-r])
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling

Change-Id: I8ebfbcea0e2ae2670553822acedde49c1aa7e98d
2014-07-24 19:43:25 +02:00
umherirrender
abfa0d7854 Standardize @todo
Always use lowercase @todo
Changed some "@FIXME" to "@todo FIXME: "

Change-Id: I016d1f9511e6f3bbd22427f0fffeccd77ab5e0db
2014-07-23 22:27:20 +02:00
Ori Livneh
a1f1850252 Check for boolean false result from database query in SqlBagOStuff
Database::select() can return false, so we should check for it before
attempting to iterate on the result or to call methods on it.

Change-Id: I0862493305e5b2784422e0e94b3e62e734267795
2014-07-21 15:13:31 +02:00
umherirrender
2b021dc48a Fixed spacing
- Added/removed spaces around parenthesis
- Added space after switch/if/foreach
- changed else if to elseif

Change-Id: I99cda543e0e077320091addd75c188cb6e3a42c2
2014-07-19 23:12:10 +02:00
Aaron Schulz
d9385014fe Avoid breaking DB transactions in SqlBagOStuff
* Callers still sees some decent time ordering since writes block
  until committed. This will not blindly flush transactions though.
* Basically reverts 59e8032

Change-Id: Ib9a91ac023f8e3fafb0bf0eef9dca6e31b867be9
2014-07-16 17:59:36 +00:00
Aaron Schulz
4c0871fa0e Made LCStoreDB try to use a separate DB connection
* This avoids breaking the main transaction in finishWrite().
* Also removed an unused variable in SqlBagOStuff.

Change-Id: Ia330ac362b080c1338616d95b793032c4752dc23
2014-07-15 19:20:01 -07:00
Erik Bernhardson
ca4690d823 Correct out of date comment
The comment claims there is no cas method, but that was
implemented in 74f581e348

Change-Id: I6ffdc255204bcb3a03b0468c18609b0d30b6269c
2014-07-11 20:07:00 -07:00
Aaron Schulz
f9ddcb0453 Made getMaxLag() use caching to reduce connection spam
* This method is currently hit when bots use the maxlag API parameter
* Also added a $fallback param to ObjectCache::newAccelerator so code
  does not have to keep reinventing that logic.

Change-Id: I45bf1085301c5cf69b29b494a146c6a067534581
2014-07-10 10:46:42 -07:00
Matthew Flaschen
737653546a Don't unserialize integer reply from Redis incrBy
It does not work with unserialize because RedisBagOStuff->unserialize
expects either strings of digits, or serialized strings.  A plain integer
is neither.

incr docs were incorrect, so fix and expand by copying from parent class.

Change-Id: Ifc9c7a36f221b251ceea0d9a79ae6c3ce5753dd4
2014-06-27 18:24:35 -04:00
jenkins-bot
ad6289a7e9 Merge "objectcache: Actually unserialize integers as integers in RedisBagOStuff" 2014-06-27 18:47:27 +00:00
Aaron Schulz
211d6062e1 Add some casts for sanity before BagOStuff::add() calls
Change-Id: I6ecb609c88e4fc1ef614e94c551199bd610ca360
2014-06-26 16:25:31 -07:00
Timo Tijhof
eb0a3b7830 objectcache: Actually unserialize integers as integers in RedisBagOStuff
Before:
> SET   (stored)    GET
>  5     5          (string) "5"
>  '5'   5          (string) "5"
>  'x'   s:1:"x";   (string) "x"

After:
> SET   (stored)    GET
>  5     5          (int) 5
>  '5'   s:1:"5";   (string) "5"
>  'x'   s:1:"x";   (string) "x"

Follows-up 2ceda41c57.

Bug: 60563
Change-Id: I2bb09381b2bb733ac5a89175e053cb10eca68b08
2014-06-26 23:06:39 +00:00
Niklas Laxström
cc0a51fd39 Don't die on empty keys in MWMemcached
Bug: 64287
Change-Id: Iedfec96286212577a181b83957cdc4545be206d2
2014-06-05 08:09:47 +00:00
Matthias Mullie
63b22fe634 Cached misses in getMulti should be omitted
SqlBagOStuff::getMulti currently returns an array with false values for missed
cache keys.
Default BagOStuff::getMulti (and other specific implementations like memcached),
however, just omit missed values.

e.g.:

    $cache->getMulti( array( 'goodkey' 'badkey' ) );

should return

    array( 'goodkey' => 'value' );

instead of

    array( 'goodkey' => 'value', 'badkey' => false );

Bug: 65637
Change-Id: Ib2de06a0f76421094707f7ad4218346087f4dc55
2014-05-22 17:19:22 +02:00
Siebrand Mazeland
a36be914c3 Pass phpcs-strict on includes/objectcache/
Change-Id: Ib99f2e34255df0cc846727b134d1788aec48529d
2014-05-11 16:52:18 +00:00
Kunal Mehta
c592011404 Add BagOStuff::setMulti for batch insertions
Includes implementions for Redis, Sql and MemcachedPecl,
other types will fallback to using $this->set repeatedly.

Change-Id: I0924a197b28ee69e883128ccd672343e5c041929
2014-04-25 15:12:22 -07:00
Aaron Schulz
89d85a4be4 Added pool counter support for all thumb.php requests
* This can limit how many workers work on a given file at once,
  regardless of which specific thumbnail parameters are requested.
* Also added a BagOStuff::incrWithInit() method per DRY.
* Tweaked the register_shutdown_function() callback to avoid
  File/MediaTransformOutput references, since they may involve
  TempFSFile objects.

Change-Id: Ic01461cb974ab23b179ac3b60cf6de12e36360f6
2014-04-23 20:57:17 +00:00
umherirrender
23bb3d1cb4 Follow-Ups to "Fixed some @params documentation"
Fix of inline comments of the following patch sets:
Follow-Up: I0056b4a8df243cfc0c5f25378de48f7a35170aca
Follow-Up: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5
Follow-Up: I3622f216a2ca8ac1b5e51892be9f98665f65bc36
Follow-Up: I6627ba0e76d3577c40bf2473e0f78a5ad7368634
Follow-Up: Id75b5ecf648ca50f955b3bde3307c82c4366b102
Follow-Up: I4ca5231119f33039d91da3b57a41cd40719a576b

Change-Id: Id9bbe84b2820e9db44af5783411e955f55f643d4
2014-04-23 13:39:49 +02:00
umherirrender
b9cd789fce docs: closure -> Closure; callback -> callable
Changed closure to capital word Closure in doc and type hint,
also changed callback in docs to callable

Change-Id: I52c8e8f13d38a837052101c38b9986be780ca057
2014-04-19 08:43:31 +02:00
umherirrender
fd66273c94 Fixed some @params documentation (includes/[cache|objectcache])
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: I86fd10e3f2d4bb80e7432533038d124693acfb3c
2014-04-19 01:19:46 +02:00
Bartosz Dziewoński
59002d8935 Consistently use '@deprecated since <version>'
Variants included 'in <version>', 'as of <version>' and just the
version number.

Some @deprecated annotations do not have the version number at all,
I want to hunt them down separately.

Change-Id: I8208c6097098f4735d4f51bc42254675f1f27f6d
2014-04-15 22:18:19 +02:00
umherirrender
23fab68274 Fix spacing after @param and friends in comments
Searched for:
\@(param|return|throws|since|deprecated|access|todo|var)[ \t]{2,}

Change-Id: Icce22ba9fe0635455691ca58d9872d618151f346
2014-04-05 20:02:29 +00:00
Alexandre Emsenhuber
28fe01dcdc Remove trailing line break check from MemcachedBagOStuff::debugLog()
wfDebugLog() already does the same, so it's unnecessary here.

Change-Id: Ia7bbbd2806fcd638861d010835c33969322d262a
2014-04-05 20:28:06 +02:00
Aaron Schulz
4d7f18f6d5 Made BagOStuff fail fast in cas/lock on certain errors
* This avoids wasting time waiting on down servers

bug: 63058
Change-Id: Ia78a2036ffa7a20102ec9e8bf941cacb7fa63435
2014-04-01 13:26:44 -07:00
Aaron Schulz
587a98aa02 Lowered high lock timeout in mergeViaLock() and lock() in BagOStuff
Change-Id: Ib5cd0a98ce6ec47edb24f8cc9f4df2c941ce1c38
2014-03-25 17:14:33 +00:00
umherirrender
2000672ac3 Fixed spacing
- Added spaces after if/foreach/catch
- Added new line before end of file
- Added or removed spaces before/after parenthesis, comma
- Added spaces around string concat

Change-Id: I0590070f1b3542108e242730e8d9a3ba9831e94f
2014-03-20 20:37:30 +00:00
Ladsgroup
a90f1a2d79 Changing URLs of mediawiki.org in scripts to the SSL-based website
http://www.mediawiki.org --> https://www.mediawiki.org

Part 3

Change-Id: Ica633881b1744fa2854f4b012b79dbf5a7e5e7e2
2014-03-13 22:28:14 +00:00
Aaron Schulz
83dd6d7e3d Deprecated useless BagOStuff::replace method
* Almost nothing actually uses this (one extension)
  as it doesn't really solve race conditions like merge().
* Removed subclassed versions too.

Change-Id: I4d4123afcc0576a90a3cbf1e4e6daff7ebce39c3
2014-03-09 02:53:04 +00:00
Aaron Schulz
4265d8f23f Added simpler handleError() method in RedisConnectionPool
* Callers should not need to give $server since it is stored in RedisConnRef

Change-Id: I902d984d6a7f19dd0d8c71ee374cbed359de378e
2014-02-12 07:29:32 +00:00