Page MenuHomePhabricator

Disable now-redundant mediawiki/TorBlock/loadExitNodes.php cron script
Closed, ResolvedPublic

Description

Follows-up T228465#5352272.

Event Timeline

@Krinkle I don't understand this task. Is the intent that the cron job in profile::openstack::eqiad1::wikitech::web be converted to a systemd timer as was done for the main cluster in profile::mediawiki::maintenance?

@bd808 As I understand it, a recent change to the TorBlock extension has made the cronjob/maintenance script obsolete.

The cron entry can be disabled/removed.

@bd808 As I understand it, a recent change to the TorBlock extension has made the cronjob/maintenance script obsolete.

The cron entry can be disabled/removed.

::profile::mediawiki::maintenance has a periodic job (aka systemd timer) for this recurring data load:

profile::mediawiki::periodic_job { 'mediawiki_tor_exit_node':
    command  => '/usr/local/bin/mwscript extensions/TorBlock/maintenance/loadExitNodes.php --wiki=aawiki --force',
    interval => '*-*-* *:00/20:00',
}
$ ssh mwmaint1002.eqiad.wmnet
$ systemctl list-timers --no-pager
NEXT                         LEFT       LAST                         PASSED    UNIT                                        ACTIVATES
Thu 2019-08-29 16:00:23 UTC  3s left    Thu 2019-08-29 15:45:23 UTC  14min ago prometheus-node-exporter-apt.timer          prometheus-node-exporter-apt.service
Thu 2019-08-29 16:01:09 UTC  50s left   Thu 2019-08-29 16:00:09 UTC  10s ago   fetch_dbconfig.timer                        fetch_dbconfig.service
Thu 2019-08-29 16:09:00 UTC  8min left  Thu 2019-08-29 15:39:00 UTC  21min ago phpsessionclean.timer                       phpsessionclean.service
Thu 2019-08-29 16:20:00 UTC  19min left Thu 2019-08-29 16:00:00 UTC  19s ago   mediawiki_job_mediawiki_tor_exit_node.timer mediawiki_job_mediawiki_tor_exit_node.service
Fri 2019-08-30 01:06:48 UTC  9h left    Thu 2019-08-29 01:06:48 UTC  14h ago   systemd-tmpfiles-clean.timer                systemd-tmpfiles-clean.service
Fri 2019-08-30 02:52:11 UTC  10h left   Thu 2019-08-29 08:00:35 UTC  7h ago    apt-daily.timer                             apt-daily.service
Fri 2019-08-30 06:38:01 UTC  14h left   Thu 2019-08-29 06:09:45 UTC  9h ago    apt-daily-upgrade.timer                     apt-daily-upgrade.service

7 timers listed.
Pass --all to see loaded but inactive timers, too.

Maybe the change was that the data is kept centrally so it only needs to be run once per cluster rather than once per wiki?

I don't understand the link with systemd timers.

It is no longer needed to run the loadExitNodes.php maintenance script. The cronjob for that maintenance script may be removed.

Implementation details: As of Gerrit changes 521020 and 524326, the MediaWiki TorBlock extension now refreshes its own data via core methods (WANCache async updates, etc.). The Memcached cache key for the data is (and was) "global", which is why the script only had to run for 1 wiki (--wiki aawiki).


EDIT: Aha, systemd timers are like cron jobs, and production has switched to those. Yeah, this isn't related to that.


EDIT (2): I assumed it was already removed in prod, but I see that's not the case. This is in just in puppet afaik, so I'll just patch it.

Change 533571 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[operations/puppet@production] mediawiki: Disable loadExitNodes.php maintenance script

https://gerrit.wikimedia.org/r/533571

Change 533572 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[operations/puppet@production] mediawiki: Remove loadExitNodes.php maintenance script

https://gerrit.wikimedia.org/r/533572

EDIT (2): I assumed it was already removed in prod, but I see that's not the case. This is in just in puppet afaik, so I'll just patch it.

Excellent. This bit was what was confusing me as well and apparently I was doing a poor job of conveying that. I'll try to get you help with review + merge of the cleanup. :)

Change 533571 merged by Andrew Bogott:
[operations/puppet@production] mediawiki: Disable loadExitNodes.php maintenance script

https://gerrit.wikimedia.org/r/533571

Joe triaged this task as Medium priority.Sep 16 2019, 2:54 PM
Joe claimed this task.
Dzahn subscribed.

reverted the last merge because it broke puppet on mwmaint servers

it's because the periodic jobs class does not have an "ensure" parameter. but maybe it does not need one.

Change 537204 had a related patch set uploaded (by Dzahn; owner: Dzahn):
[operations/puppet@production] mediawiki::maintenance: remove TorExit node periodic job

https://gerrit.wikimedia.org/r/537204

Change 537204 merged by Dzahn:
[operations/puppet@production] mediawiki::maintenance: remove TorExit node periodic job

https://gerrit.wikimedia.org/r/537204

Change 533572 merged by Dzahn:
[operations/puppet@production] mediawiki: Remove loadExitNodes.php maintenance script

https://gerrit.wikimedia.org/r/533572