From: Gergő Tisza Date: Fri, 17 Feb 2017 00:47:49 +0000 (-0800) Subject: Demote "throttler data not found" logs to info level X-Git-Tag: 1.31.0-rc.0~4068^2 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=7dcefe44682d513cf2700a3e5dba6b276f3f64c7;p=lhc%2Fweb%2Fwiklou.git Demote "throttler data not found" logs to info level Bug: T158364 Change-Id: I049c2d6da4720341ef2a380879ac19aff444b1d0 --- diff --git a/includes/auth/ThrottlePreAuthenticationProvider.php b/includes/auth/ThrottlePreAuthenticationProvider.php index 3f6a47d2d3..ae0bc6bb77 100644 --- a/includes/auth/ThrottlePreAuthenticationProvider.php +++ b/includes/auth/ThrottlePreAuthenticationProvider.php @@ -167,7 +167,9 @@ class ThrottlePreAuthenticationProvider extends AbstractPreAuthenticationProvide $data = $this->manager->getAuthenticationSessionData( 'LoginThrottle' ); if ( !$data ) { - $this->logger->error( 'throttler data not found for {user}', [ 'user' => $user->getName() ] ); + // this can occur when login is happening via AuthenticationRequest::$loginRequest + // so testForAuthentication is skipped + $this->logger->info( 'throttler data not found for {user}', [ 'user' => $user->getName() ] ); return; } diff --git a/tests/phpunit/includes/auth/ThrottlePreAuthenticationProviderTest.php b/tests/phpunit/includes/auth/ThrottlePreAuthenticationProviderTest.php index 20f4cbc44d..2f3e27c6fe 100644 --- a/tests/phpunit/includes/auth/ThrottlePreAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/ThrottlePreAuthenticationProviderTest.php @@ -226,7 +226,7 @@ class ThrottlePreAuthenticationProviderTest extends \MediaWikiTestCase { $provider->postAuthentication( \User::newFromName( 'SomeUser' ), AuthenticationResponse::newPass() ); $this->assertSame( [ - [ \Psr\Log\LogLevel::ERROR, 'throttler data not found for {user}' ], + [ \Psr\Log\LogLevel::INFO, 'throttler data not found for {user}' ], ], $logger->getBuffer() ); } }