Commit graph

23 commits

Author SHA1 Message Date
Aaron Schulz
51945dbca3 Use DB domain in JobQueueGroup and make WikiMap domain ID methods stricter
Using domains means thats JobQueueDB has the right value to use for calls
like LoadBalancer::getConnection(). The full domain includes the schema in
the case of Postgres. This makes calls to getConnection() less awkward by
not relying on the fallback logic in reallyOpenConnection() for null schemas.

Make getWikiIdFromDomain/isCurrentWikiDomain account for the schema if it
is both defined and is not simply the generic "mediawiki" schema MediaWiki
uses by default. If all wikis use the default schema, the wiki IDs can get
by with DB/prefix alone, which various config and methods may be built around.
Otherwise, the config callbacks must account for schema and the config must
include it in various wiki domain ID lists to properly disambiguate wikis.

Also, clean up SiteConfiguration::siteFromDB() since it is not meant
to handle schemas unless the callback method was taylored to do so.

Finally, add more comments to DefaultSettings.php about already existing
limitations of wiki domain IDs and their components.

Change-Id: I8d94a650e5c99a19ee50551c5be9544318eb05b1
2018-11-07 04:46:56 +00:00
Bartosz Dziewoński
485f66f174 Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '

(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)

Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).

Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
2018-05-30 18:06:13 -07:00
Tim Starling
dc2948d76d A few doc comment fixups
* Remove some creation dates, they are not protected by GPL
* Remove duplicate @defgroup API
* Remove @ingroup from some @file doc comments on class files. It is not
  useful to list class files alongside classes in the doxygen module menu.
  Add @ingroup to some more class files that had @ingroup on their file,
  that was probably the author's intent.
* In PackedOverlayImageGallery, use the file comment as a class comment
* Don't put @defgroup and @file in the same comment. @defgroup makes the
  whole doc comment describe the group.
* Instead of putting AnsiTermColorer in two groups, use hierarchical
  groups.

Change-Id: If54f6e0b2bc1ea6de42045885cf836ee67b8e961
2017-12-04 11:11:52 +11:00
Umherirrender
f739a8f368 Improve some parameter docs
Add missing @return and @param to function docs and fixed some @param

Change-Id: I810727961057cfdcc274428b239af5975c57468d
2017-09-10 20:32:31 +02:00
Aaron Schulz
82e2c924e4 Remove "@author Aaron Schulz" annotations
Bug: T139301
Change-Id: Ib5248e8e27d60611c7373bce4b29dd5e85aa3489
2017-06-27 15:24:14 -07:00
Erik Bernhardson
d67197fa11 Cleanup some incorrect return annotations
Most of these are simply changing annotations to reflect
reality. If a function can return false to indicate failure
the @return should indicate it.

Some are fixing preg_match calls, preg match returns 1, 0 or false,
but the functions all claim to return booleans.

This is far from all the incorrect return types in mediawiki, there
are around 250 detected by phan, but have to start somewhere.

Change-Id: I1bbdfee6190747bde460f8a7084212ccafe169ef
2016-12-12 10:15:05 -08:00
Aaron Schulz
10593ffaab Move RedisConnectionPool to /libs/redis
Change-Id: Ied4a85d7172ab76b90f6d9ce4d47a83c3fd7d111
2016-09-23 00:20:19 -07: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
Aaron Schulz
2f2641dbda No-op the notify*/purge methods in JobQueueAggregatorRedis
This should be managed by the background service now

Change-Id: I5d905760b509f66e10019ff8a4146db8a6c4c9d7
2015-12-17 16:43:43 -08:00
jenkins-bot
7d3fc7346d Merge "Revert "Avoid doNotifyQueueEmpty() race conditions for Redis"" 2015-11-17 01:32:21 +00:00
Aaron Schulz
08ec4d97fb Make JobQueueAggregator::doNotifyQueueNonEmpty() avoid queries
Avoid 2 of the 3 queries in doNotifyQueueNonEmpty(), the ones
that register the queue, once such a command has been done in
the request already.

Change-Id: I58553f0c56660f05a3e3000065270baebb8cbb62
2015-11-15 20:16:31 +00:00
Aaron Schulz
d8666c0e22 Revert "Avoid doNotifyQueueEmpty() race conditions for Redis"
This might hitting a phpredis bug causing "read error" messages.

This reverts commit ab2e1dae28.

Bug: T118430
Change-Id: I45b009e8768b79368898762bfedbca4dc0a79943
2015-11-12 00:40:33 +00:00
Aaron Schulz
ab2e1dae28 Avoid doNotifyQueueEmpty() race conditions for Redis
Previously, races could cause queues to be seen as empty
and ignored when they actually have jobs in them.

Change-Id: I6cdf5c1fbd33c9ed7982e5d2d494974b1d7e09fd
2015-11-10 14:34:24 -08:00
Vivek Ghaisas
665f1a033d Ensure that files end with a newline
Bug: T102619
Change-Id: Iae6e722151581d15c9421d41c4d14b100bb6e437
2015-06-16 16:21:57 +03:00
Aaron Schulz
ff83473c81 Made JobQueueAggregatorRedis make sure the wiki set key is up-to-date
Change-Id: I84ccfd990fada80ee3005b746d33ed4473abb6d8
2015-05-02 13:07:55 -07:00
Aaron Schulz
37042262e3 Moved some JobQueueAggregator logic out of JobQueueGroup
Change-Id: I28ba1a25db225d4cf5f503a6c0f4405f13118151
2015-03-03 21:56:15 -08:00
Aaron Schulz
b15ac8eb48 Removed pointless memcached JobQueueAggregator class
* On a basic/default install there is only a single wiki 
  and nothing uses this. Larger wikis would want to use redis.

Change-Id: Ie5bf1a644ae60b2c6ca72b165fa5510113717611
2015-03-03 20:46:52 +00: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
umherirrender
44d14fc684 Doc: Reformat @params declaration
I have not found documentation about the @params command, so this seems
not valid.
I have moved the text to the corresponding @param

Change-Id: I443866d602b60570278289e6e24a77d37314cede
2014-07-24 13:12:18 +02:00
Aaron Schulz
821fadb67d Fixed JobQueueAggregatorRedis to handle empty collections
* Previously it would keep polling if the hash was empty since
  empty and non-existing collections are the same in Redis.
* Also turned off the pointless PHP serialization.
* Bumped the cache version key; this change should be deployed
  in all wikis at once, along with updating the runners.

Change-Id: I33dc55bc579bf678f14a5383e9e2c3c35231d599
2014-07-22 15:12:02 +00:00
Aaron Schulz
911d50b022 Also set the queue types map when rebuilding the ready queue map
Change-Id: I0686859541661a22131c387d8fac6dc7b074c18c
2014-06-05 09:24:59 -07:00
Aaron Schulz
a759746409 Track the types of queues in the redis queue aggregator
* This tracks all queue types in one simple location that
  can be inspected without using MediaWiki.

Change-Id: I197664b9aa620b29f1400e5a60c55a301348120d
2014-06-04 22:29:51 +00:00
Aaron Schulz
9ffd4f085d Renamed /job to /jobqueue
Change-Id: I4c8a2b42140630838867c77a70d45ba14b5d95e2
2014-03-14 13:42:04 -07:00