Commit graph

29 commits

Author SHA1 Message Date
Chad
bfbc44648d Revert "JobQueueGroup: Improve failed-to-insert error"
I made a useless commit.

This reverts commit a82cb5aa18.

Change-Id: I70328bcbcf9af5480c7a0b8e297ed41a463fd457
2018-02-23 08:05:13 +00:00
Chad Horohoe
a82cb5aa18 JobQueueGroup: Improve failed-to-insert error
This could possibly use LoggerFactory & friends to use them as
parameters, but either way let's sort the entries so they're
at least remotely capable of self-grouping.

Change-Id: Iaf435093d70add02e2f82e3037c64fec11870979
2018-02-23 01:57:11 +00:00
Aaron Schulz
df7ec19a12 Disallow job pushes from JobQueueGroup to bogus wikis
Bug: T171371
Change-Id: I03a5dbd18cf6b5bcacb3ec07cef9e0b051bc147c
2017-08-11 14:56:47 -07:00
Aaron Schulz
82e2c924e4 Remove "@author Aaron Schulz" annotations
Bug: T139301
Change-Id: Ib5248e8e27d60611c7373bce4b29dd5e85aa3489
2017-06-27 15:24:14 -07:00
Seb35
24842cfac0 Use AutoCommitUpdate instead of Database->onTransactionIdle
This is needed for deferred updates LinksDeletionUpdate and LinksUpdate, else
callbacks registered with onTransactionIdle prevent other transactions from
being executed, at least in this case.

Bug: T154425
Bug: T154438
Bug: T157679
Change-Id: Iecd396d584a62ac936cd963915339159467b44cd
2017-06-06 14:23:37 +02:00
Seb35
e00f7180b3 Prevent PHPDBG from issuing notices in unit tests
Although issuing PHP notices in unit tests is only a nice-to-have, the cause
is PHPDBG has no special treatment in JobQueueGroup at the contrary of the
PHP SAPI 'cli', and it may be desirable both 'command line SAPIs' have the
same behaviour.

This is the most apparent difference between cli and phpdbg but there could
be a dozen of other occurrences (see bug), potentially creating differences
in unit tests depending on the SAPI.

Bug: T162591
Change-Id: Idf9c14db72f1f768c5a17b49ed689a05922c57d3
2017-04-10 13:32:15 +02:00
Aaron Schulz
83e8d972fe Avoid triggering SiteConfiguration lookup in JobQueueGroup::push()
Just use $wgJobTypesExcludedFromDefaultQueue directly

Bug: T145819
Change-Id: I0d978cdbef40ced98880c1a7d7524fd2b7438bfc
2016-09-16 11:16:19 -07:00
Aaron Schulz
6f9a246d25 Make JobQueueGroup::push() update the queuesHaveJobs() cache
This makes it so jobs can run sooner with $wgJobRunRate

Bug: T145206
Change-Id: Ia7673f51312f90a696fa056bd3daf7f3f440782b
2016-09-11 04:57:12 -07:00
Aaron Schulz
16266edff3 Change "slave" => "replica DB" in /includes
Change-Id: Icb716219c9335ff8fa447b1733d04b71d9712bf9
2016-09-05 21:01:01 +00:00
Aaron Schulz
ea1f4e8a53 Add TTL_PROC_* constants for clarity
This makes the reason for the cache times more obvious

Change-Id: Ie75df6be77c513feeb6cff3417ccbc124a6a1141
2016-05-06 23:45:41 +00:00
Aaron Schulz
148dadcee6 Catch errors in pushLazyJobs() and log them
This happens post-send anyway, so throwing errors is not
very useful and the other post-send updates are independent.

Change-Id: Ife8f9825da9592be1a38cf4c757550213838463b
2016-04-20 17:34:40 +00:00
Aaron Schulz
b4ab40d2e8 Enforce $wgReadOnly for job queues
Bug: T130795
Change-Id: I9d8cf919de80dbe855086b9c590c0a0f20dc33b9
2016-04-18 21:11:08 +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
Aaron Schulz
097ae101ae Convert JobQueueGroup::getCachedConfigVar to using WAN cache
Change-Id: I793ab8c11698a1c6f6c3bdd20c61b3645ca5d544
2015-11-05 10:53:58 -08:00
Timo Tijhof
e8275758fe objectcache: Introduce IExpiringStore for convenient TTL constants
Also consistently use self:: instead of BagOStuff:: for constants
referenced within the BagOStuff class.

Change-Id: I20fde9fa5cddcc9e92fa6a02b05dc7effa846742
2015-10-28 04:07:25 +00:00
Aaron Schulz
92bbfd5ea6 Migrate more callers away from $wgMemc
Callers should use more expliciy lazy-loaded
cache factory methods.

Change-Id: Ifa0bf389720a09a931ee6466b993f787d83a09a7
2015-10-26 19:07:12 +00:00
Erik Bernhardson
ca2dbb8aeb Log what job types were never inserted
I am seeing a constant stream of

	Notice: JobQueueGroup::__destruct: 1 buffered job(s) never inserted. in
	/srv/mediawiki/php-1.26wmf6/includes/jobqueue/JobQueueGroup.php on line 419

In the production logfiles.  Log what type of jobs these are so we can figure out
how to fix them.

Change-Id: I7beca910d8c4b20aa20bdec4883e399fd94fbcfd
2015-05-27 16:13:33 +02:00
Aaron Schulz
2a176864eb Made pushLazyJobs() handle all queue groups
* This avoids __destruct() warnings
* Also remove push() code in __destruct() that just made
  more warnings since it's too late

Change-Id: I32a3cfabc94e36b9d2808b45d55209f3df46e47d
2015-05-19 02:12:28 +00:00
Aaron Schulz
7e97ce6a44 Added JobQueueGroup::lazyPush method
* Made use of this in triggerOpportunisticLinksUpdate()
* This will defer and better batch job insertion
* Lazy job insertion and other deferred updates
  make use of register_postsend_function if present
* Also cleaned up some return types and exceptions
  in JobQueueGroup

Bug: T99302
Change-Id: I3a3968d75cb37563f970be08e63f31a090e0e037
2015-05-18 16:26:59 +00:00
Aaron Schulz
ec3da97659 Removed executeReadyPeriodicTasks() method
* Moved all these hacks to JobQueueDB, which is the only queue that
  should need this (for stock installs). Newer queues should always
  have the queue store manage stuff like this, not MediaWiki.
* This also avoids expensive object construction that does nothing
  when non-DB queues are used.

Change-Id: Id718cda25750be73044a049b39958cca55aa3172
2015-05-06 20:20:40 -07:00
Aaron Schulz
37042262e3 Moved some JobQueueAggregator logic out of JobQueueGroup
Change-Id: I28ba1a25db225d4cf5f503a6c0f4405f13118151
2015-03-03 21:56:15 -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
addshore
f960c2434b Add tests for Job::toString
Change-Id: I00f41808af42a198a1e45a93201dd7bb3e4d9c2c
2014-09-23 21:57:31 +01:00
Aaron Schulz
06116453c0 Made executeReadyPeriodicTasks avoid using merge() when not needed
Change-Id: I9bb3a5af6ebd12ac5a31578e17142fb0a2dba029
2014-06-04 15:34:57 -07:00
Thiemo Mättig
e292bc972d Finish removing boolean return values from JobQueue code
This is a follow-up for patch
Ia706ac0122a7dd7f418e2dc2d3bd36e9a0252c25.

Change-Id: I19fe58a939706d3f7594d937e0bcad6d97c52a50
2014-04-28 22:21:58 +02:00
umherirrender
dcf6955e5c Fixed some @params documentation (includes/*)
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: Ifbb1da2a6278b0bde2a6f6ce2e7bd383ee3fb28a
2014-04-20 23:33:05 +02:00
Aaron Schulz
94c37ffb96 Revert "Revert "Removed useless JobQueue return values""
Made the obvious update to a caller missed in the change.

This reverts commit c76d5a95c1.

Change-Id: I67400ba5b9fc7de16c9f9d5075c488c5e58cea9e
2014-04-16 11:22:31 -07:00
Aaron Schulz
4865e34630 Avoid making a derivative request to Special:RunJobs when the job queue is empty
Checking that the job queue is nonempty is cheap, and when the result is
negative (that is, when the queue is actually empty), it spares from having to
launch a derivative request to Special:RunJobs for job processing. The
derivative request is not cheap, because processing it requires having an
additional full instance of the application. This patch adds the check.

Bug: 60210
Change-Id: Icb95c35f4a8a3c9d4b5aff97fdfabf596d05940a
2014-04-09 22:49:46 -07:00
Aaron Schulz
9ffd4f085d Renamed /job to /jobqueue
Change-Id: I4c8a2b42140630838867c77a70d45ba14b5d95e2
2014-03-14 13:42:04 -07:00
Renamed from includes/job/JobQueueGroup.php (Browse further)