Change-Id: If7b2330aa8cdf49ae25e5c0af5cb3ffc3f40b257
- // Ignore warnings about master connections/writes...hard to avoid here
- \Profiler::instance()->getTransactionProfiler()->resetExpectations();
-
$backoffKey = wfMemcKey( 'AuthManager', 'autocreate-failed', md5( $username ) );
if ( $cache->get( $backoffKey ) ) {
$this->logger->debug( __METHOD__ . ': {username} denied by prior creation attempt failures', [
$backoffKey = wfMemcKey( 'AuthManager', 'autocreate-failed', md5( $username ) );
if ( $cache->get( $backoffKey ) ) {
$this->logger->debug( __METHOD__ . ': {username} denied by prior creation attempt failures', [
+ // Ignore warnings about master connections/writes...hard to avoid here
+ $trxProfiler = \Profiler::instance()->getTransactionProfiler();
+ $trxProfiler->setSilenced( true );
try {
$status = $user->addToDatabase();
if ( !$status->isOk() ) {
try {
$status = $user->addToDatabase();
if ( !$status->isOk() ) {
return $status;
}
} catch ( \Exception $ex ) {
return $status;
}
} catch ( \Exception $ex ) {
+ $trxProfiler->setSilenced( false );
$this->logger->error( __METHOD__ . ': {username} failed with exception {exception}', [
'username' => $username,
'exception' => $ex,
$this->logger->error( __METHOD__ . ': {username} failed with exception {exception}', [
'username' => $username,
'exception' => $ex,
// Update user count
\DeferredUpdates::addUpdate( new \SiteStatsUpdate( 0, 0, 0, 0, 1 ) );
// Update user count
\DeferredUpdates::addUpdate( new \SiteStatsUpdate( 0, 0, 0, 0, 1 ) );
// Watch user's userpage and talk page
// Watch user's userpage and talk page
- $user->addWatch( $user->getUserPage(), User::IGNORE_USER_RIGHTS );
+ \DeferredUpdates::addCallableUpdate( function () use ( $user ) {
+ $user->addWatch( $user->getUserPage(), User::IGNORE_USER_RIGHTS );
+ } );
// Log the creation
if ( $this->config->get( 'NewUserLog' ) ) {
// Log the creation
if ( $this->config->get( 'NewUserLog' ) ) {
// the newly-created user doesn't get lost.
wfGetLBFactory()->commitMasterChanges( __METHOD__ );
// the newly-created user doesn't get lost.
wfGetLBFactory()->commitMasterChanges( __METHOD__ );
+ $trxProfiler->setSilenced( false );
+
if ( $login ) {
$this->setSessionDataForUser( $user );
}
if ( $login ) {
$this->setSessionDataForUser( $user );
}