Commit graph

30 commits

Author SHA1 Message Date
Aaron Schulz
e3227eeda6 Lowered the default OPT_READ_TIMEOUT for Redis
* This should probably be low for the case of a server that is
  quick to accept connections but slow to do anything.
* Made the client class handle blocking operations sanely
  by automatically boosting/lowering the timeout value.

Change-Id: Idea083b843f7eb558d2daf249deea853c9ec43ae
2014-07-08 04:04:48 +00:00
Aaron Schulz
c6a7a3a9ed Set Redis::OPT_READ_TIMEOUT by default
* The value is also configurable just like connectTimeout
* This deals with problems like https://github.com/nicolasff/phpredis/issues/99
  and https://github.com/nicolasff/phpredis/issues/70

Change-Id: I05e91e05764020854d04673b7decae30359f57e9
2014-05-05 20:25:09 +00: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
829886b10a Fixed some @params documentation
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.

Change-Id: I64e8cfe478cb0ba438f40b0631d6e9049cdab567
2014-04-14 12:59:19 +00:00
Siebrand Mazeland
3f6004a288 Fix spelling: occurred
Change-Id: Ic307db2362b00f15eaac781587bfe9c1d074194f
2014-04-08 11:08:46 +02:00
Alexandre Emsenhuber
449ee32451 Add missing line breaks to wfDebug() calls
Also removed true as second parameter to it from CloneDatabase.php
since it is the default value of that parameter.

Change-Id: I727ebae2bd4df0e26019985ce8c7ce73381c5642
2014-03-29 11:52:07 +01: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
Alexandre Emsenhuber
8d701eeeea Remove trailing line breaks from wfDebugLog() messages
This is useless since the message is passed through trim() and a
line break is added afterwards.

Change-Id: I1a26b30a07f7c9c749fce5bb6b2b4b3d79901b7c
2014-02-04 22:16:13 +01:00
Tim Starling
05b2f0b6da Improve redis connection error log
Include the server name in the log entry for exceptions thrown during
connect. We are logging a lot of these.

Change-Id: Ia3f775a9e22447efb067c3203a3b80c4385aa2c0
2013-12-15 20:07:23 +01:00
Aaron Schulz
ee574b9c6a Added some sanity close() calls to RedisConnectionPool
Change-Id: Icd0e249a1524f880c99986c9bea3b891ab9b9ba6
2013-11-20 13:49:51 -08:00
Siebrand Mazeland
6ed3220897 Remove unused local variable and update documentation
Change-Id: I5a737511f8c0234451fba766b529594e6244fb95
2013-11-19 21:52:31 +01:00
Siebrand Mazeland
77ce0042ed Update formatting
Change-Id: I5cd038afb609eb71e86b7e23839083cea2531e1a
2013-11-19 20:40:50 +01:00
Aaron Schulz
8c1a12677c Added fail-over support to JobQueueAggregatorRedis using "redisServers" option
* Also cleaned up various bits of documentation errors and cruft

Change-Id: Icccae5329941e4311fef02b6137a6b90f39f9046
2013-11-18 16:49:32 +00:00
Aaron Schulz
146ea32031 Expanded use of reauthenticateConnection() beyond just Lua calls
* Also made it so luaEval() does not clear any previous errors to callers.
  None of the native methods have that behavoir, so this is more consistent.

Bug: 56886
Change-Id: I47d0f52e72b35ec5cb7b92b9cc3488f145b2d7a2
2013-11-15 02:42:53 +00:00
Aaron Schulz
ea86cbb224 Fixed redis reconnect handling when passwords are used in luaEval()
Change-Id: Ifc974e6787d180f9b14624481ffe7c456f689254
2013-11-05 14:43:49 -08:00
Aaron Schulz
81202351ca Include server in redis lua errors
Change-Id: Ib8dbed08fa9d8010d496475de44f61aca31fd410
2013-11-04 13:43:44 -08:00
Ori Livneh
23c9c5546e Allow RedisConnectionPool to be used with HHVM's Redis library
As of commit 2811e9d, HHVM includes a pure-PHP Redis client library with
method-for-method compatibility with phpredis: <http://git.io/ylDAyQ>.
RedisConnectionPool appears to work well with it save for the
extension_loaded() check. Practically a freebie!

Bug: 54158
Change-Id: I3ac12293a51a45e8f6a61a35bff7a3c063e16964
2013-09-19 10:11:38 -07:00
Antoine Musso
43ae2fb6f9 doc: various updates
[includes/cache/MessageCache.php]
- internal constants
- constructor
- a few missing @var

[includes/clientpool/RedisConnectionPool.php]
- group internal settings applying to the pool
- misc protected members updates

[includes/debug/Debug.php]
- missing parameter name in @var statements

Change-Id: I6ff0a68d659529d128f40f32b0fd1c1d39af952f
2013-05-20 12:02:37 +02:00
Aaron Schulz
3e49fd4af2 Factored JobQueueRedis::redisEval() into RedisConnRef::luaEval().
Change-Id: I1b4bb4f4bb5e25fc3f358c9e2b16e4672584c68b
2013-04-19 01:55:45 +00: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
Aaron Schulz
5131bbadd1 Moved some RedisConnectionPool docs to the factory function.
Change-Id: I4183b96e123882de604de1484456abcd10091fb2
2013-03-19 11:15:57 +00:00
Aaron Schulz
a646351d83 Allow having no serializer in RedisConnectionPool.
Change-Id: If367c26b6b19374d1445c406851e2c5d3e5cc634
2013-03-13 14:28:28 -07:00
Aaron Schulz
f399458604 Fixed redis auth error spam in logs.
Change-Id: I52e074b530d4dba2a0a8ec9b7d32f96d4527c6f4
2013-03-11 16:18:25 -07:00
Aaron Schulz
45e72198d9 Fixed connection comparison in RedisConnectionPool::handleException().
* This was comparing a Redis with a RedisConnRef.

Change-Id: I6353736c8ad42a18d90e8474d38398d305950346
2013-03-11 22:57:33 +00: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
Aaron Schulz
646051d36d Removed "poolSize" option from RedisConnectionPool.
* The size is now automatically based on the number of servers.

Change-Id: I6ea53378c9c8254e8556c0a1e4efe64fd71ba356
2013-03-08 06:38:50 +00:00
Aaron Schulz
1ca99fa957 Resolve config defaults in RedisConnectionPool in the singleton().
* This can avoid fragmentation when applying defaults to different
  config arrays actually gives the same resulting array.

Change-Id: Iacab8d38080f51eb3f331d55a8535eed6d93b381
2013-03-01 14:55:22 -08:00
Aaron Schulz
7e6ad48641 Avoid pool fragmentation in RedisConnectionPool.
* Avoid fragmenting the client pools due to "poolSize" differences.
  Instead that config parameter does not affect the pool something uses,
  but the pool used will grow to fit the pool size of anything using it.

Change-Id: Ibc9db7cfc277824b1acde5e6fbf1db0ed296cb41
2013-02-26 20:47:27 +00:00
Aaron Schulz
abd562162c Fixed some comments and removed redundant constant.
* Also normalized params in RedisConnectionPool to avoid fragmentation.

Change-Id: I803dae52262b974836817d2091725f044faf7022
2013-02-11 10:11:52 -08:00
Aaron Schulz
03833b54e8 [JobQueue] Added a JobQueueRedis class.
* The Job class now includes an extra "metadata" field now for usage
  by the queue classes. This is useful for stores that lack IDs.
* A RedisConnectionPool class was added for reusability.

Change-Id: Ie72536240e27fe1caf11096cdc4c85dfa821d181
2013-01-22 11:09:58 -08:00