Commit graph

57 commits

Author SHA1 Message Date
Aaron Schulz
d32b64235f Switch some callers to WaitConditionLoop
Also fixed up backwards documentation

Change-Id: I00c36aa751a79ca86a754e049a6da78cbb417b81
2016-09-08 19:29:18 -07:00
jenkins-bot
1b8eac21ab Merge "A few more DBLockManager fixes and cleanups" 2016-08-24 03:15:31 +00:00
Aaron Schulz
de1044de2c Fix broken lockmanager-fail-releaselock status messages
Change-Id: Icb0cfa6e38bc81c35430023afe50dd94ef3b2013
2016-08-23 16:05:05 +00:00
Aaron Schulz
8f47c177e3 A few more DBLockManager fixes and cleanups
* Do not do the connection init step if the same DB handle as
  wfGetDB( DB_MASTER ) is being used to avoid clobbering it.
* Remove begin(), since only one of the subclasses wants
  transactions. That one now uses startAtomic() now.
* Make getConnection() throw an error for bad config instead
  of return null, which was not documented or expected.

Change-Id: Ib09a7972d6569c29e83e329a8f7f9f47a393b896
2016-08-22 22:05:47 -07:00
Aaron Schulz
7f3faf091f Split DBLockManager classes into their own files
Change-Id: If903a90a5be2d6ff11504d34eb125e86c1ab1191
2016-08-20 10:33:37 -07:00
Aaron Schulz
8ad0394d69 Fix DBLockManager comments
Change-Id: I5431caf4b80995c71d4bc5ab739954d70081111a
2016-08-15 14:29:04 -07:00
Aaron Schulz
8b15f8456f Unbreak "localDBMaster" mode in MySqlLockManager by using a separate connection
Change-Id: I4f9328e1555d814e0849cea86aca20896c6dfacf
2016-07-29 19:18:58 -07:00
Aaron Schulz
20c5c48bb1 filebackend: Fix DBLockManager IDEA warnings
Change-Id: I5e671bcee0915f65082c139be8f42aafad6413f1
2016-07-22 23:37:37 +00:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Reedy
00c426e3c2 Replace wfBaseConvert with Wikimedia\base_convert
Change-Id: Iadab3d018c3559daf79be90edb23d131729bdb68
2015-11-24 22:51:42 +00:00
umherirrender
78328dee73 Use Database::fetchRow instead of array cast
Change-Id: I71435955de604a9b3c2b2570e144b55b35421e4c
2015-11-20 20:44:56 +01:00
Timo Tijhof
8a821011ce Remove getLocalServerInstance try/catch in UIDGenerator and DBLockManager
Follows-up 17c91ad610 in which the exception was removed.

Change-Id: If0c8465d0e04f69f29f3f2602dac7ae4538f7542
2015-11-02 22:16:05 +00:00
Aaron Schulz
17c91ad610 Replace newAccelerator() with getLocalServerInstance()
The name is clearer and more consistent, with simpler arguments.

Change-Id: I7205a99ce033e8b086a52cd02c8a721e99c84b1e
2015-11-02 21:39:08 +00:00
Aaron Schulz
7c07943eab Update more docs and type hints to use IDatabase
Change-Id: I8c8d85b32a8aba21e14d2a2dde4c25eb509186c1
2015-10-06 18:49:52 -07:00
Aaron Schulz
639388755c Removed unused LockManager var
Change-Id: I02c1fef624e6f2fe04e3c6d525aaed881eacabd7
2015-09-20 13:57:46 -07:00
Timo Tijhof
79ce51d1c9 objectcache: Make first parameter of newAccelerator optional
Makes it more convenient to use.

Change-Id: I1e11f7a759bd2816e47d1c2453cbe39b8f44b2f0
2015-08-24 23:43:19 +02:00
Kunal Mehta
f6e5079a69 Use mediawiki/at-ease library for suppressing warnings
wfSuppressWarnings() and wfRestoreWarnings() were split out into a
separate library. All usages in core were replaced with the new
functions, and the wf* global functions are marked as deprecated.

Additionally, some uses of @ were replaced due to composer's autoloader
being loaded even earlier.

Ie1234f8c12693408de9b94bf6f84480a90bd4f8e adds the library to
mediawiki/vendor.

Bug: T100923
Change-Id: I5c35079a0a656180852be0ae6b1262d40f6534c4
2015-06-11 18:49:29 +00:00
Aaron Schulz
a611ebf1ff Changed FileBackend exceptions to subclass Exception
Change-Id: Ic7d4d6cf0dde3e93ef78758b1a6b03f78c9bcdba
2015-01-17 14:48:00 -08:00
Aaron Schulz
6921770414 Updated some try-catch statements: MWException -> Exception
Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
2015-01-09 17:20:22 -08:00
Chad Horohoe
aa21e125a3 Remove obvious function-level profiling
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.

Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.

Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
2015-01-07 11:14:24 -08:00
Ricordisamoa
fc5fd5c37a Typo fixes and non-code tweaks
Skipped replacements:
* prefered → preferred
* prolly → probably

Skipped files:
* resources/lib/jquery.ui/jquery.ui.mouse.js
* resources/lib/jquery/jquery.form.js

Change-Id: Ib7923f362ddfca1b892bf5d601785d6b5aa5d44c
2014-12-12 18:31:15 +00:00
Aaron Schulz
54f1b2373b Tweaked some of the default LockManager ttls
Change-Id: Ic2c58ef02dc686f38840fe974a9d2858cd15c019
2014-10-23 22:19:19 -07:00
umherirrender
b883e8c7c0 Cleanup some docs (includes/[e-l])
- 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: I41a84e8e1dec39170aa655250325ffc485eaeaef
2014-07-24 19:43:03 +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
umherirrender
957adbef22 Fixed some @params documentation (includes/[file...|upload])
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: I8804ebe0922d3a414863b162a2110e0b9e49b80f
2014-04-19 17:19:17 +02: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
Siebrand Mazeland
f077c4b1d6 Update formatting
Change-Id: I18aff576262479c9bb1c56eb8e1d1aaae200e4b1
2014-02-06 09:27:05 +01:00
Aaron Schulz
a0eef4ef0d Removed expiremental LSLockManager class
* This is pretty much obsoleted by RedisLockManager

Change-Id: I0feff44b5833072c8eb5a598169e1bb271d49de2
2014-01-17 15:16:01 -08:00
Aaron Schulz
b0d7bcf0b7 Made redis lock manager get EX/SH locks in one go
* Also made the TTLs properly per-lock as they should be
* Also properly extract type/session from the keys in LUA

Change-Id: I4608b7d551ac7aa4b3f7e2f5ce92b50662b1d4e4
2013-12-07 23:06:51 -07:00
Siebrand Mazeland
0bea715396 Add missing return value
According to the documentation, the return value should be a Status.

Change-Id: Ib4c9730b50ef95ed1f0659f61554d7f442a017de
2013-11-23 20:24:43 +00:00
Siebrand Mazeland
8f90b1cfa8 Fix various type and reference issues
Change-Id: Iced174d9f94faf80c5fa21e15fa6c81b6d8fa21c
2013-11-23 20:50:02 +01:00
Siebrand Mazeland
34a4bcbd48 Update documentation of file backend classes
Change-Id: I2113aecc53f1b361d9c276113bc0a9f7076cd21c
2013-11-23 19:24:43 +01:00
Siebrand Mazeland
a5c35215e2 Update formatting of file backend classes
Change-Id: Ie69c324e2f1ea0b8a654adee06ebda494cebd10c
2013-11-22 22:17:15 +01:00
Aaron Schulz
25d1af122d lockmanager: QuorumLockManager subclasses can get EX/SH locks at once
* Also reduced rount trips in doUnlockingRequestBucket().
* Also removed some redundant doc comments.

Change-Id: I81878e92332509bd7fda9ddeef950b774f5b015d
2013-10-22 17:18:07 +00:00
Aaron Schulz
0ec0e19262 [LockManager] Made it easier to get both SH and EX locks at once.
* This also makes it possible for subclasses to optimize this case.
* Added a timeout parameter to ScopedLock::factory().
* Cleaned up a few bits of documentation.

Change-Id: Id3e9cf01f25ab498ea00d87ffb6d00aa8b05052b
2013-06-05 05:46:21 +00:00
umherirrender
1bfc8feb25 Fixed spacing in actions/cache/filebackend/filerepo/job folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Idb93d34e314e5f314223b79208968d6bcd30c40e
2013-04-20 19:18:13 +02:00
Aaron Schulz
ed01e81359 [LockManager] Added a RedisLockManager class.
Change-Id: I7ade74eb307a5075533f36836768af60f106a6b9
2013-04-18 20:18:54 -07: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
0193a82d56 [LockManager] Added timeout to the lock() function.
Change-Id: I32f97b813fc6036b2774d67c14c574420e7a1437
2013-04-02 22:28:15 +00:00
Aaron Schulz
95e463e1d9 [LockManager] Refactor lock TTL code to base class.
* Also made the TTL configurable.

Change-Id: I713979267fe7bd92ac6cd5fe4d4168d20e539c75
2013-03-18 05:25:35 +00:00
Aaron Schulz
2135b80fcd [LockManager] Various fixes to lock managers.
* Improved handling of corrupt values in cache for MemcLockManager.
  Also improved the use of Status warnings a bit.
* Removed broken special-case handling for SH->EX lock escalation.
  Updated MysqLockManager to compensate.
* Made FSLockManager only use one handle per file, which is more
  efficient and avoids errors when escalating locks (SH->EX).
* Made lock unit tests have more useful output on failure.

Change-Id: Ib304712fa2b6b3fd02bfc1b08b6f238c771960c2
2013-03-12 04:14:47 +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
98dc0349b2 [LockManager] Added ScopedLock::release function.
* Added more lock unit tests.

Change-Id: Ic359307cf26cfb621ae8d2db867801735a375dde
2013-03-05 13:33:51 -08:00
Aaron Schulz
fdef79d9f2 [LockManager] Created PostgreSqlLockManager class.
* Made DBLockManager abstract instead of a hacky blocking implementation.
  With a PG and MySQL option, that option is no longer useful.

Change-Id: I939551bd2283608f2d017d9d2fca1334a533c005
2013-02-15 04:06:10 +00:00
Aaron Schulz
58b5193ef5 [LockManager] Renamed getBucketFromKey() -> getBucketFromPath().
Change-Id: I825dcd255f0b85f81bf925abf46bc46b1fe42e9f
2013-02-01 10:55:12 -08:00
Aaron Schulz
a4f27a198f [LockManager] Generallized wiki field to a domain field.
* In some cases (like certain qualified file backends), a domain
  may be desired that is not simple a wiki ID.
* Also added a LockManangerGroup::config() function to export
  the configuration of a lock manager.

Change-Id: I5a75c55be3cc9017ed8a717d6d30e466fd00340f
2013-02-01 10:40:45 -08:00
jenkins-bot
5111115ef1 Merge "[LockManager] Updated DBLockManager for cross-wiki support." 2013-02-01 18:06:04 +00:00
Aaron Schulz
7224c402ca [LockManager] Split QuorumLockManager into its own file.
Change-Id: Ib487a39b04ac9de3449695ac388c95ae45933469
2013-01-31 22:29:44 -08:00
Aaron Schulz
2693fa5d1b [LockManager] Updated DBLockManager for cross-wiki support.
Change-Id: If02274a3173463ce66037221f494a1ee68ffa51d
2013-01-31 18:26:24 -08:00
Aaron Schulz
5b67e492ff [LockManager] Refactoring to allow proper cross-wiki support.
Change-Id: I331d011a6fa4edd434f0fb547d325ad60901119d
2013-01-28 11:03:33 -08:00