Page MenuHomePhabricator

Remove writing to $wgCommandLineMode from RunSingleJob.php
Closed, ResolvedPublic

Description

RunSingleJob.php sets $wgCommandLineMode only after an exception was thrown:
https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/e673cccabc288368b4dc52e937794660f600606e/rpc/RunSingleJob.php#97

This is documented with "Since output is logged to file, get MediaWiki to generate a raw error". This would make a bit of sense, but the output is not actually logged to file, as far as I can tell. I can't find any such logging in the code calling RunSingleJob.php (actually, I can't find the code calling it, it's all YAML definitions, but they don't mention logging: https://codesearch.wmcloud.org/search/?q=RunSingleJob.php), and I can't find any evidence of it in Logstash (we have plenty of exceptions logged from RunSingleJob.php itself: https://logstash.wikimedia.org/goto/d0c91bdf2f6079dc24a0ae7633fd976a but when I try to search for these error messages and exclude it, I find nothing).

So the command-line-style output is either unused, or it's so cleverly hidden that I can't find it. Let's try removing it, and see if anyone complains.

Event Timeline

Change 982414 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[operations/mediawiki-config@master] RunSingleJob.php: Remove overly complicated error handling

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

Change 982415 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[operations/mediawiki-config@master] RunSingleJob.php: Stop writing to $wgCommandLineMode

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

Change 982414 merged by jenkins-bot:

[operations/mediawiki-config@master] RunSingleJob.php: Remove overly complicated error handling

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

Mentioned in SAL (#wikimedia-operations) [2023-12-14T08:38:23Z] <ariel@deploy2002> Started scap: Backport for [[gerrit:982414|RunSingleJob.php: Remove overly complicated error handling (T353262)]]

Mentioned in SAL (#wikimedia-operations) [2023-12-14T08:39:53Z] <ariel@deploy2002> matmarex and ariel: Backport for [[gerrit:982414|RunSingleJob.php: Remove overly complicated error handling (T353262)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2023-12-14T08:47:02Z] <ariel@deploy2002> Finished scap: Backport for [[gerrit:982414|RunSingleJob.php: Remove overly complicated error handling (T353262)]] (duration: 08m 39s)

Change 982415 merged by jenkins-bot:

[operations/mediawiki-config@master] RunSingleJob.php: Stop writing to $wgCommandLineMode

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

Mentioned in SAL (#wikimedia-operations) [2023-12-14T08:54:26Z] <ariel@deploy2002> Started scap: Backport for [[gerrit:982415|RunSingleJob.php: Stop writing to $wgCommandLineMode (T353262)]]

Mentioned in SAL (#wikimedia-operations) [2023-12-14T08:56:17Z] <ariel@deploy2002> ariel and matmarex: Backport for [[gerrit:982415|RunSingleJob.php: Stop writing to $wgCommandLineMode (T353262)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2023-12-14T09:03:31Z] <ariel@deploy2002> Finished scap: Backport for [[gerrit:982415|RunSingleJob.php: Stop writing to $wgCommandLineMode (T353262)]] (duration: 09m 05s)