From 9130b0395c2c1a0e39172b358169f28c1c29d13a Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 8 Jun 2018 15:14:05 -0700 Subject: [PATCH] Add more logging to ChronologyProtector::initPositions() Bug: T194403 Change-Id: I8f1ccb3c6e257ae48ae6bbecd8f2a8f51cd2ed41 --- includes/libs/rdbms/ChronologyProtector.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/libs/rdbms/ChronologyProtector.php b/includes/libs/rdbms/ChronologyProtector.php index f5cef9eab7..72ca5901c2 100644 --- a/includes/libs/rdbms/ChronologyProtector.php +++ b/includes/libs/rdbms/ChronologyProtector.php @@ -43,6 +43,8 @@ class ChronologyProtector implements LoggerAwareInterface { protected $key; /** @var string Hash of client parameters */ protected $clientId; + /** @var string[] Map of client information fields for logging */ + protected $clientInfo; /** @var int|null Expected minimum index of the last write to the position store */ protected $waitForPosIndex; /** @var int Max seconds to wait on positions to appear */ @@ -81,6 +83,9 @@ class ChronologyProtector implements LoggerAwareInterface { : md5( $client['ip'] . "\n" . $client['agent'] ); $this->key = $store->makeGlobalKey( __CLASS__, $this->clientId, 'v2' ); $this->waitForPosIndex = $posIndex; + + $this->clientInfo = $client + [ 'clientId' => '' ]; + $this->logger = new NullLogger(); } @@ -308,7 +313,7 @@ class ChronologyProtector implements LoggerAwareInterface { [ 'cpPosIndex' => $this->waitForPosIndex, 'waitTimeMs' => $waitedMs - ] + ] + $this->clientInfo ); } else { $this->logger->warning( @@ -317,7 +322,7 @@ class ChronologyProtector implements LoggerAwareInterface { 'cpPosIndex' => $this->waitForPosIndex, 'indexReached' => $indexReached, 'waitTimeMs' => $waitedMs - ] + ] + $this->clientInfo ); } } else { -- 2.20.1