MediaWiki 1.29.0-rc.0 (4e4d48d) PHP 7.1.1 (apache2handler) MariaDB 10.1.21-MariaDB ICU 57.1
While investigating some missing data updates during a DeferredUpdates execution, I found that any DeferrableUpdate that throws an exception isn't logged and a discovery of correlating issues is made very difficult.
\DeferredUpdates::addUpdate( new TestStorage( 'test 1', true ) ); \DeferredUpdates::addUpdate( new TestStorage( 'test 2' ) );
WikiPage::doEditUpdates: Using prepared edit... Saved in parser cache with key mw-29-00:pcache:idhash:13-0!*!0!*!en!*!* and timestamp 20170619224136 and revision id 110 Title::getRestrictionTypes: applicable restrictions to [[Test]] are {edit,move} MediaWiki::preOutputCommit: pre-send deferred updates completed [cookie] setcookie: "cpPosTime", "1497912097.112", "1497912157", "/", "", "", "1" [DBReplication] Wikimedia\Rdbms\ChronologyProtector::shutdownLB: DB 'localhost' touched MediaWiki::preOutputCommit: LBFactory shutdown completed OutputPage::sendCacheControl: private caching; ** [test] SMW\TestStorage::doUpdate before exception test 1 Request ended normally [session] Saving all sessions on shutdown [DBConnection] Closing connection to database 'localhost'. [DBConnection] Closing connection to database 'localhost'.
class TestStorage implements DeferrableUpdate { private $origin; private $throwException; public function __construct( $origin, $throwException = false ) { $this->origin = $origin; $this->throwException = $throwException; } public function doUpdate() { $msg = $this->throwException ? 'exception' : ''; wfDebugLog( 'test', __METHOD__ . " before $msg $this->origin" ); if ( $this->throwException ) { throw new \Exception( "DeferrableUpdate forced exception" ); } wfDebugLog( 'test', __METHOD__ . " after $msg $this->origin" ); } }
As demonstrated in the output, [test] SMW\TestStorage::doUpdate before exception test 1 is logged before an exception is thrown put anything after that is hidden and silent.
error_reporting(E_STRICT|E_ALL); ini_set("display_errors", 1); $wgShowExceptionDetails = true; $wgDevelopmentWarnings = true; $wgShowSQLErrors = true; $wgDebugDumpSql = false; $wgShowDBErrorBacktrace = true; $wgDebugLogFile = ".../debug-{$wgDBname}.log";