Commit graph

50 commits

Author SHA1 Message Date
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Antoine Musso
58f390e9bf missing $dbr instance in JobQueue
This comes from factoring done with commit fb69ee4. To add quotes based
on the database type, we actually need a Database instance!

Fault introduced by https://gerrit.wikimedia.org/r/9116

Change-Id: I7a4f7fb1a744cd7adb5166e66424b664edb3d9e8
2012-05-30 21:17:30 +02:00
Aaron Schulz
5097ada351 Merge "(bug 37072) - prevents infinite job loop" 2012-05-29 20:19:58 +00:00
Aaron Schulz
90108d8c93 Merge "wfProfileOut() for new return added in c6396 (c4e407c)" 2012-05-29 18:08:25 +00:00
Platonides
2c15039e4d wfProfileOut() for new return added in c6396 (c4e407c)
Change-Id: I9fed0ba277fb32df65a772c8c4de123e2867b4c5
2012-05-29 19:34:43 +02:00
Antoine Musso
fb69ee48d3 (bug 37072) - prevents infinite job loop
nextJob.php does not honor jobs types being excluded from the default
job queue by using $wgJobTypesExcludedFromDefaultQueue. Since those jobs
can never get processed, nextJob.php will always return a database which
might produce a nasty infinite loop while trying to process the whole
queue.

Job::pop did take in account wgJobTypesExcludedFromDefaultQueue to
filter the jobs out. So this patch factor out the code in a new method
and uses it for nextJob.php.

Change-Id: I15197ffcca00f229c9004e2abd87e009bc40f384
2012-05-29 13:50:44 +02:00
Alexandre Emsenhuber
aad9d5fd6b Removed checks for the "MEDIAWIKI" constant on files that only define classes.
This checks are not needed in that case.

Change-Id: Ia83447427de8b7ea32aced8ff43c7a252b8d504c
2012-05-23 21:20:42 +02:00
daniel
a12ce17c6e Generalizing LinksUpdate to allow extensions to add arbitrary update handlers.
This supercedes I6d03bf2a, using better names for the new classes and
incorporating the changes requested by Aaron.

This change introduces the base class SecondaryDataUpdate to be used for any
updates that need to be applied when a page is changed or deleted. Until now,
this was done by the LinksUpdate class for updates and WikiPage::doDeletionUpdates
upon deletion. This patch uses a list of SecondaryDataUpdates in both cases.

This allows extensions (e.g. via the ContentHandler facility, once that is in) to
easily specify what needs to be done when a page is updated or deleted in order to
keep any secondary data stores (such as link tables) in sync.

Note that limited transactional logic is also introduced, so SecondaryDataUpdate
can be implemented to only commit their changes if all updates were performed
sucessfully.

Patch Set 2: fixing some coding style issues mentioned by Nikerabbit.

Patch Set 4: some stuff I kept from the old LinksUpdate class needs cleanup,
             but might break extensions when changed. Marking as todo for now.

Patch Set 5: fixed misnamed member in LinksDeletionUpdate (thanks Aaron).

Change-Id: Ibe3e88fadd8c1d4063cf13bb6972f2a23569a73f
2012-05-13 20:53:37 +02:00
Aaron Schulz
ec299eabb6 Merge "add type check and bail out when title could not be created" 2012-05-07 23:03:03 +00:00
Alexandre Emsenhuber
63176b99b7 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I1deb70318d01a257b51948ba806d80cd1a239f4f
2012-05-04 08:47:07 +02:00
jeroendedauw
c4e407cf6c add type check and bail out when title could not be created
Change-Id: I5d931892d8f8f70a3dc13d0ed73413de47d43f53
2012-05-02 17:04:55 +02:00
Sam Reed
c47f83a4d4 More __METHOD__ in our madness 2012-02-24 18:45:24 +00:00
Sam Reed
138ddc452f Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 17:42:35 +00:00
Sam Reed
0bab706cdf Fix non reverted job_insert_timestamp
Fixup timestamp addition per Roan

Ping r107886
2012-01-03 15:14:35 +00:00
Sam Reed
faca3cb2e7 * (bug 27724) Add timestamp to job queue.
Designed for administration purposes, not to be exposed to front end users

Useful for administration purposes (like WMF with job runners), we can look at the "highest" jobs, and find out whether enwiki is just busy, or the jobs have been there a while (signalling that the job runners potentially have issues)
2012-01-03 15:08:05 +00:00
Roan Kattouw
792c38f424 (bug 26854) Invalid user names go unchecked. Applied most of the patch submitted by Søren Løvborg, checking for null return values from User::newFromName() 2011-11-20 10:55:58 +00:00
Alexandre Emsenhuber
6c6cb64095 * Use WikiPage instead of Article since we only need to call doEdit()
* Pass the User object to doEdit() in addition to the override of $wgUser
2011-11-01 16:41:36 +00:00
Sam Reed
4622da783c More documentation! 2011-10-26 04:15:09 +00:00
Alexandre Emsenhuber
d491ae56a7 Follow-up r100227:
* Missed one call to ParserOptions::getUserLang() in Parser
* Also convert RefreshLinksJob and RefreshLinksJob2 to use ParserOptions::newFromUserAndLang() and pass $wgContLang instead of whatever $wgLang could be
2011-10-19 15:30:02 +00:00
Sam Reed
8a082cbf5c * (bug 31081) $wgEnotifUseJobQ causes many unnecessary jobs to be queued
Do some of the cheap checks before spawning attempting to send emails via any method
2011-09-22 12:14:21 +00:00
Roan Kattouw
8d72cebad0 Followup r94435: don't barf on jobs inserted before this revision that don't have a table param 2011-09-12 10:18:26 +00:00
Ian Baker
53f3c48a95 Removed the ability to pass a key into stashFile(), which simplifies the stash row creation a great deal.
Updated UploadFromUrlJob to properly use the database stash
followup to r92200
2011-08-15 23:58:40 +00:00
Victor Vasiliev
80a7648a42 Allow extensions to run their own backlink-based updates:
* Introduce new hooks which allow BacklinkCache to handle non-core tables
* Make table name a parameter to RefreshLinks2 job (instead of hardcoded templatelinks)
2011-08-13 22:42:09 +00:00
Tim Starling
1bbfb2a313 Non-concurrent pop_type() since the $row === false case was being hit 99% of the time on WMF in a backlog situation. 2011-07-12 08:08:58 +00:00
Aaron Schulz
fc3a285e66 * Follow-up r84397: make sure that mysql uses the job_id index even with the job_cmd clause
* Removed redundant 'LIMIT' option, already added by using selectRow()
2011-06-30 20:32:41 +00:00
Sam Reed
4065e65d03 Even more documentation in various files 2011-05-29 14:24:27 +00:00
Sam Reed
296f3d3f4f And even more documentation 2011-05-28 18:59:42 +00:00
Platonides
62053ac8fd Merge r86398 into the old wfWaitForSlaves. Update core calls.
maintenance/waitForSlave.php still calls the old prototype.
Most instances were replaced with 
sed -i 's/wfWaitForSlaves( [0-9]* );/wfWaitForSlaves();/' ./maintenance/initEditCount.php ./maintenance/updateRestrictions.php ./maintenance/updateSpecialPages.php ./maintenance/importDump.php ./maintenance/moveBatch.php ./maintenance/storage/resolveStubs.php ./maintenance/storage/trackBlobs.php ./maintenance/storage/fixBug20757.php ./maintenance/storage/moveToExternal.php ./maintenance/storage/compressOld.inc ./maintenance/populateSha1.php ./maintenance/deleteDefaultMessages.php ./maintenance/migrateUserGroup.php ./maintenance/importImages.php ./maintenance/runJobs.php ./maintenance/archives/upgradeLogging.php ./maintenance/deleteBatch.php ./maintenance/populateLogSearch.php ./maintenance/populateLogUsertext.php ./maintenance/gearman/gearmanWorker.php ./maintenance/populateRevisionLength.php ./maintenance/refreshLinks.php ./maintenance/deleteSelfExternals.php ./maintenance/upgrade1_5.php ./maintenance/rebuildFileCache.php ./includes/job/RefreshLinksJob.php ./includes/installer/MysqlUpdater.php ./maintenance/convertUserOptions.php ./maintenance/populateParentId.php ./maintenance/runBatchedQuery.php ./maintenance/upgrade1_5.php ./maintenance/waitForSlave.php ./maintenance/populateCategory.php ./maintenance/importImages.php
2011-04-20 00:12:06 +00:00
Sam Reed
d3f043c53a Add/update/improve various bits of documentation 2011-03-25 11:21:53 +00:00
Roan Kattouw
45f9da8ad7 (bug 27336) Add $wgJobTypesExcludedFromDefaultQueue for job types that aren't supposed to be run by 'normal' job runners. Modified patch by Michael Dale 2011-03-20 16:52:57 +00:00
Aaron Schulz
da6d61f8b0 * Fixed wfIncrStats calls from r83617 (I assume this wants the # of jobs added)
* Follow up r83494, r74737: allow for proper db rollback of a user renames (addresses code comments added in r74737)
2011-03-18 07:06:18 +00:00
Tim Starling
005f53fe15 Fix duplicate removal. Was completely broken, with a "job_id IS NULL" condition in the delete query. Added a COMMIT to pop_type(). 2011-03-10 11:39:23 +00:00
Tim Starling
e20d18cbf3 Stats for duplicate removal 2011-03-10 02:27:15 +00:00
Tim Starling
24bf07cc86 * Add a $count argument to wfIncrStats(), to allow it to increase the count by more than one at a time.
* Added stats to job insert and pop.
* Formalised live patch for UDP stats aggregation, adding $wgAggregateStatsID.
2011-03-10 00:00:34 +00:00
Sam Reed
f123c151c3 Commit some uncommited documentation from my w/c 2011-02-28 16:37:34 +00:00
Sam Reed
4530507815 More function documentation 2011-02-19 21:56:54 +00:00
Mark A. Hershberger
b4cee86beb w/s fixups 2011-02-12 04:06:22 +00:00
Platonides
49074e8a56 Yet more additions of wfProfileOut() 2011-02-10 16:39:53 +00:00
Alexandre Emsenhuber
e84e6c62b8 Revert r76174 and call directly UserMailer::send() 2010-11-06 16:22:18 +00:00
Platonides
2acc3291f9 Add require for UserMailer.php, which defines the backwards compatibility userMailer() function. 2010-11-06 00:14:45 +00:00
Sam Reed
6b3b915353 Big attack on unused variables... 2010-10-14 20:53:04 +00:00
Bryan Tong Minh
3e1eff2a01 Follow-up r70137: Made asynchronous upload working a bit more. It now fully works from the API; works still needs to be done for the normal UI. PHPUnit tests are updated and should cover most code paths that can be called from the API.
ApiUpload:
* Added "statuskey" parameter; this is the key that is returned by an async upload
* Refactored warnings transformation into its own function
* filename is no longer required on all uploads

UploadFromUrlJob:
* Moved upload results to its own entry in $_SESSION, instead of using the one from upload
* Fix storing in session by calling wfSetupSession and session_write_close where needed

Tests:
* Set $wgUser in ApiSetup, so that individual tests don't have to do this for themselves
* Added tests to cover most code paths from the API
* Fixed UploadFromUrlTestSuite so that its tests are included in a regular phpunit invocation (something strange with the AutoLoader; not sure what)

Other files:
* Allow passing session id to wfSetupSession
* Explicitly close the session before doing jobs, so that jobs can't manipulate the current session
2010-09-06 10:18:53 +00:00
Alexandre Emsenhuber
c9790ba8e8 Fixed some doxygen warnings 2010-09-04 15:08:02 +00:00
Alexandre Emsenhuber
7e4af9cf7f added file description header 2010-09-03 18:24:42 +00:00
Bryan Tong Minh
c7e3a8915d Fix UploadFromUrl test cases, UploadFromUrlJob::run return value, and disable broken features in UploadFromUrlJob
* Use a more specific filename in UploadFromUrlTest and fix some assertions. 
* Return boolean from UploadFromUrlJob::run
* Force ignorewarnings and leavemessage in UploadFromUrlJob
2010-07-29 18:39:42 +00:00
Bryan Tong Minh
d7e6870b8f Made asynchronous upload by URL working, partly. Hid it behind $wgAllowAsyncCopyUploads. If there are no errors then everything works expected; the same if there are unrecoverable errors. User intervention to solve warnings is not yet possible, because $_SESSION is not available in runJobs. This also means that async with leavemessage = false is broken.
Other changes:
* Moved verifyPermissions check in ApiUpload down pending r70135 implementation in the API.
* In User::leaveMessage: append message to end of talk page; add a newline before the heading
2010-07-29 13:53:51 +00:00
Bryan Tong Minh
796933d11f Restructured upload-by-url:
* In ApiUpload: moved stuff that is checking instead of actual uploading out of performUpload method
* Made UploadFromUrl conform to standards: 
** In initialize* do only initialization, no actual work
** Moved file fetching to fetchFile
** Consistent use of tempnam()
** Perform the uploading in performUpload, don't define our own doUpload method
* Moved almost all job magic to the UploadFromUrlJob class. This way the job is almost a regular client, and we don't need many special cases to deal with async uploading. 
* Made leaving a message optional; results will be stored in the session otherwise

I did not actually test the async uploading, because I first wanted to commit a properly working synchronous upload-by-url system.
2010-07-28 17:14:51 +00:00
Max Semenik
28dd709f13 Removed commented-out deprecated function 2010-07-09 13:45:09 +00:00
Mark A. Hershberger
e5cc87957f Move jobqueue classes to their own directory. 2010-05-14 16:23:26 +00:00