MWExceptionHandler: Rename rollbackMasterChangesAndLog to rollbackPrimaryChangesAndLog
Change-Id: I9a90b4f74eb65cd9e20ae9faa6d1949be96543c0
This commit is contained in:
parent
7c06047203
commit
3407458ea0
8 changed files with 24 additions and 9 deletions
|
|
@ -497,6 +497,8 @@ because of Phabricator reports.
|
|||
- RevDelList::reloadFromMaster -> ::reloadFromPrimary()
|
||||
- ExternalStoreDB::getMaster -> ::getPrimary()
|
||||
- DatabaseMysqlBase::getMasterServerInfo() -> ::getPrimaryServerInfo()
|
||||
- MWExceptionHandler::rollbackMasterChangesAndLog() ->
|
||||
::rollbackPrimaryChangesAndLog()
|
||||
* wfIncrStats(), deprecated in 1.36, now emits deprecation warnings.
|
||||
* wfCanIPUseHTTPS() is now deprecated, and always returns true.
|
||||
* The UserLoadFromDatabase hook has been deprecated. It had no known uses.
|
||||
|
|
|
|||
|
|
@ -845,7 +845,7 @@ class MediaWiki {
|
|||
try {
|
||||
$this->restInPeace();
|
||||
} catch ( Throwable $e ) {
|
||||
MWExceptionHandler::rollbackMasterChangesAndLog(
|
||||
MWExceptionHandler::rollbackPrimaryChangesAndLog(
|
||||
$e,
|
||||
MWExceptionHandler::CAUGHT_BY_ENTRYPOINT
|
||||
);
|
||||
|
|
|
|||
|
|
@ -902,7 +902,7 @@ class ApiMain extends ApiBase {
|
|||
// T65145: Rollback any open database transactions
|
||||
if ( !$e instanceof ApiUsageException ) {
|
||||
// ApiUsageExceptions are intentional, so don't rollback if that's the case
|
||||
MWExceptionHandler::rollbackMasterChangesAndLog(
|
||||
MWExceptionHandler::rollbackPrimaryChangesAndLog(
|
||||
$e,
|
||||
MWExceptionHandler::CAUGHT_BY_ENTRYPOINT
|
||||
);
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class RefreshSecondaryDataUpdate extends DataUpdate
|
|||
DeferredUpdates::attemptUpdate( $update, $this->lbFactory );
|
||||
} catch ( Exception $e ) {
|
||||
// Try as many updates as possible on the first pass
|
||||
MWExceptionHandler::rollbackMasterChangesAndLog( $e );
|
||||
MWExceptionHandler::rollbackPrimaryChangesAndLog( $e );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -119,11 +119,11 @@ class MWExceptionHandler {
|
|||
*
|
||||
* This method is used to attempt to recover from exceptions
|
||||
*
|
||||
* @since 1.23
|
||||
* @since 1.37
|
||||
* @param Throwable $e
|
||||
* @param string $catcher CAUGHT_BY_* class constant indicating what caught the error
|
||||
*/
|
||||
public static function rollbackMasterChangesAndLog(
|
||||
public static function rollbackPrimaryChangesAndLog(
|
||||
Throwable $e,
|
||||
$catcher = self::CAUGHT_BY_OTHER
|
||||
) {
|
||||
|
|
@ -147,6 +147,19 @@ class MWExceptionHandler {
|
|||
self::logException( $e, $catcher );
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 1.37; please use rollbackPrimaryChangesAndLog() instead.
|
||||
* @param Throwable $e
|
||||
* @param string $catcher CAUGHT_BY_* class constant indicating what caught the error
|
||||
*/
|
||||
public static function rollbackMasterChangesAndLog(
|
||||
Throwable $e,
|
||||
$catcher = self::CAUGHT_BY_OTHER
|
||||
) {
|
||||
// wfDeprecated( __METHOD__, '1.37' );
|
||||
self::rollbackPrimaryChangesAndLog( $e, $catcher );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to use with PHP's set_exception_handler.
|
||||
*
|
||||
|
|
@ -182,7 +195,7 @@ class MWExceptionHandler {
|
|||
* @param string $catcher CAUGHT_BY_* class constant indicating what caught the error
|
||||
*/
|
||||
public static function handleException( Throwable $e, $catcher = self::CAUGHT_BY_OTHER ) {
|
||||
self::rollbackMasterChangesAndLog( $e, $catcher );
|
||||
self::rollbackPrimaryChangesAndLog( $e, $catcher );
|
||||
self::report( $e );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -377,7 +377,7 @@ class JobRunner implements LoggerAwareInterface {
|
|||
// Run any deferred update tasks; doUpdates() manages transactions itself
|
||||
DeferredUpdates::doUpdates();
|
||||
} catch ( Throwable $e ) {
|
||||
MWExceptionHandler::rollbackMasterChangesAndLog( $e );
|
||||
MWExceptionHandler::rollbackPrimaryChangesAndLog( $e );
|
||||
$status = false;
|
||||
$error = get_class( $e ) . ': ' . $e->getMessage();
|
||||
$caught[] = get_class( $e );
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class AssembleUploadChunksJob extends Job {
|
|||
);
|
||||
$this->setLastError( get_class( $e ) . ": " . $e->getMessage() );
|
||||
// To be extra robust.
|
||||
MWExceptionHandler::rollbackMasterChangesAndLog( $e );
|
||||
MWExceptionHandler::rollbackPrimaryChangesAndLog( $e );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class PublishStashedFileJob extends Job {
|
|||
$this->setLastError( get_class( $e ) . ": " . $e->getMessage() );
|
||||
// To prevent potential database referential integrity issues.
|
||||
// See T34551.
|
||||
MWExceptionHandler::rollbackMasterChangesAndLog( $e );
|
||||
MWExceptionHandler::rollbackPrimaryChangesAndLog( $e );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue