Commit graph

12 commits

Author SHA1 Message Date
Umherirrender
94792e97be maintenance: Cleanup use of exit in Maintenance::execute implementation
Returning void from execute() is success.
Returning true is success, false is failure with exit(1)
Using fatalError also using exit(1)

Change-Id: I1d40430ad6226e4aab8f0810b03ee1213282d123
2021-08-30 19:48:27 +00:00
James D. Forrester
719cf161f2 More master -> primary documentation and internal var renaming
Bug: T254646
Change-Id: I63cc8895033714bdfbf09aee933a8f0a43b387f3
2021-07-15 11:20:20 +01:00
Ammarpad
7974d518c5 MysqlMaintenance: Make use of Maintenance::fatalError
This simplifies the code by using base Maintenance class abstraction

Change-Id: Ib476101247cb8e1c9e0142a7d7acc29a89472bdf
2021-02-28 05:24:09 +00:00
daniel
3ba4e1a16f Fix --group option for mysql.php
Change-Id: I95b1923f94be680cfde7cbc7e4bee18ca6150442
2021-02-09 13:03:51 +01:00
Ariel T. Glenn
c9c2995a1a in deployment-prep some groups don't exist, permit scripts that use them to run
Example, there are dump scripts that use mysql.php with group=dump and these
work fine in production where the groups are, but die in deployment-prep.
Instead of dying, try to get any replica for the wiki and use that instead.

Bug: T269377
Change-Id: I54e295175a8a78d886b9390c15a0cacd16d41a15
2021-02-09 12:29:31 +02:00
James D. Forrester
4f2d1efdda Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse
Change-Id: I94a0ae83c65e8ee419bbd1ae1e86ab21ed4d8210
2020-01-10 09:32:25 -08:00
Kunal Mehta
99007e96c7 Use namespaced IPUtils class
Change-Id: I047e099a93203a59093946d336a143d899d0271f
2020-01-01 02:36:49 -08:00
Thiemo Kreuz
9314453c93 Make use of the list() feature where it makes sense
This code is functionally identical, but less error prone (not so easy
to forget or mix these numerical indexes).

This patch happens to touch the Parser, which might be a bit scary. We
can remove this file from this patch if you prefer.

Change-Id: I8cbe3a9a6725d1c42b86e67678c1af15fbc5961a
2019-03-24 20:12:23 +00:00
Thiemo Kreuz
b7cd670cb7 maintenance: Remove unused code from several maintenance scripts
The most notable removal is done in the orphans script. This code was
really never used. Brion introduced it in 2005, already disabled.

I have all the respect for what Brion did. I just think it does not make
much sense to keep code around for so long if it does not work anyway,
and must be rewritten from scratch anyway now that we have multi-content
revisions and such.

Change-Id: I4e8050929f90e44a6e6051bf938993a8b0cdf649
2019-03-03 16:57:19 +00:00
Umherirrender
dffd07efe1 Fix param doc of MysqlMaintenance::runMysql
Add missing var name and type

Change-Id: I26c84723ee28b21f6b9b654d9507ed680c07055a
2018-08-06 10:58:53 +02:00
Tim Starling
9dcd605d13 In mysql.php ignore SIGINT
Every foreground process with the terminal open will receive SIGINT when
the interrupt key is pressed. But mysql handles SIGINT and kills the
running query, we don't want the wrapper to exit in that case. So,
ignore SIGINT while mysql is running. This is similar to how a shell
deals with this problem.

The other options would have been:

* Close the filehandles in PHP after forking (probably impossible)
* Use pcntl_exec() so that PHP isn't running (more complicated and
  requires the pcntl extension anyway)
* Clear termcap ISIG flag (probably would have broken mysql)

Bug: T199152
Change-Id: I7660cd24e036fbe3fe36d12563ffe1c1fa2360d0
2018-07-18 15:57:15 +10:00
Tim Starling
25503cf011 Maintenance script to wrap the mysql binary
This is more or less equivalent to the WMF shell script "sql", but it is
reasonably portable and written in a less hackish way.

Change-Id: I240d8d4e65ce46680cac257ee376a9b026c13f92
2018-05-31 15:42:51 +10:00