}
public function destroy() {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+
$this->forEachLBCallMethod( 'disable' );
}
&$cpIndex = null,
&$cpClientId = null
) {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+
$chronProt = $this->getChronologyProtector();
if ( $mode === self::SHUTDOWN_CHRONPROT_SYNC ) {
$this->shutdownChronologyProtector( $chronProt, $workCallback, 'sync', $cpIndex );
final public function beginMasterChanges( $fname = __METHOD__ ) {
$this->assertTransactionRoundStage( self::ROUND_CURSORY );
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+
$this->trxRoundStage = self::ROUND_BEGINNING;
if ( $this->trxRoundId !== false ) {
throw new DBTransactionError(
final public function commitMasterChanges( $fname = __METHOD__, array $options = [] ) {
$this->assertTransactionRoundStage( self::ROUND_CURSORY );
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+
$this->trxRoundStage = self::ROUND_COMMITTING;
if ( $this->trxRoundId !== false && $this->trxRoundId !== $fname ) {
throw new DBTransactionError(
"$fname: transaction round '{$this->trxRoundId}' still running"
);
}
- /** @noinspection PhpUnusedLocalVariableInspection */
- $scope = ScopedCallback::newScopedIgnoreUserAbort(); // try to ignore client aborts
// Run pre-commit callbacks and suppress post-commit callbacks, aborting on failure
do {
$count = 0; // number of callbacks executed this iteration
}
final public function rollbackMasterChanges( $fname = __METHOD__ ) {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+
$this->trxRoundStage = self::ROUND_ROLLING_BACK;
$this->trxRoundId = false;
// Actually perform the rollback on all master DB connections and revert DBO_TRX
}
public function closeAll() {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+
$this->forEachLBCallMethod( 'closeAll' );
}
}
public function closeAll() {
+ if ( $this->ownerId === null ) {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+ }
+
$fname = __METHOD__;
$this->forEachOpenConnection( function ( IDatabase $conn ) use ( $fname ) {
$host = $conn->getServer();
public function finalizeMasterChanges( $fname = __METHOD__, $owner = null ) {
$this->assertOwnership( $fname, $owner );
$this->assertTransactionRoundStage( [ self::ROUND_CURSORY, self::ROUND_FINALIZED ] );
+ if ( $this->ownerId === null ) {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+ }
$this->trxRoundStage = self::ROUND_ERROR; // "failed" until proven otherwise
// Loop until callbacks stop adding callbacks on other connections
public function approveMasterChanges( array $options, $fname = __METHOD__, $owner = null ) {
$this->assertOwnership( $fname, $owner );
$this->assertTransactionRoundStage( self::ROUND_FINALIZED );
+ if ( $this->ownerId === null ) {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+ }
$limit = $options['maxWriteDuration'] ?? 0;
);
}
$this->assertTransactionRoundStage( self::ROUND_CURSORY );
+ if ( $this->ownerId === null ) {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+ }
// Clear any empty transactions (no writes/callbacks) from the implicit round
$this->flushMasterSnapshots( $fname );
public function commitMasterChanges( $fname = __METHOD__, $owner = null ) {
$this->assertOwnership( $fname, $owner );
$this->assertTransactionRoundStage( self::ROUND_APPROVED );
+ if ( $this->ownerId === null ) {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+ }
$failures = [];
- /** @noinspection PhpUnusedLocalVariableInspection */
- $scope = ScopedCallback::newScopedIgnoreUserAbort(); // try to ignore client aborts
-
$restore = ( $this->trxRoundId !== false );
$this->trxRoundId = false;
$this->trxRoundStage = self::ROUND_ERROR; // "failed" until proven otherwise
"Transaction should be in the callback stage (not '{$this->trxRoundStage}')"
);
}
+ if ( $this->ownerId === null ) {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+ }
$oldStage = $this->trxRoundStage;
$this->trxRoundStage = self::ROUND_ERROR; // "failed" until proven otherwise
"Transaction should be in the callback stage (not '{$this->trxRoundStage}')"
);
}
+ if ( $this->ownerId === null ) {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+ }
$e = null;
public function rollbackMasterChanges( $fname = __METHOD__, $owner = null ) {
$this->assertOwnership( $fname, $owner );
+ if ( $this->ownerId === null ) {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+ }
$restore = ( $this->trxRoundId !== false );
$this->trxRoundId = false;