// Record ChronologyProtector positions for DBs affected in this request at this point
$cpIndex = null;
- $lbFactory->shutdown( $flags, $postCommitWork, $cpIndex );
+ $cpClientId = null;
+ $lbFactory->shutdown( $flags, $postCommitWork, $cpIndex, $cpClientId );
wfDebug( __METHOD__ . ': LBFactory shutdown completed' );
if ( $cpIndex > 0 ) {
if ( $allowHeaders ) {
- $expires = time() + ChronologyProtector::POSITION_TTL;
+ $now = time();
+ $expires = $now + ChronologyProtector::POSITION_COOKIE_TTL;
$options = [ 'prefix' => '' ];
- $request->response()->setCookie( 'cpPosIndex', $cpIndex, $expires, $options );
+ $value = LBFactory::makeCookieValueFromCPIndex( $cpIndex, $now, $cpClientId );
+ $request->response()->setCookie( 'cpPosIndex', $value, $expires, $options );
}
if ( $strategy === 'cookie+url' ) {
try {
$statsdServer = explode( ':', $config->get( 'StatsdServer' ) );
$statsdHost = $statsdServer[0];
- $statsdPort = isset( $statsdServer[1] ) ? $statsdServer[1] : 8125;
+ $statsdPort = $statsdServer[1] ?? 8125;
$statsdSender = new SocketSender( $statsdHost, $statsdPort );
$statsdClient = new SamplingStatsdClient( $statsdSender, true, false );
$statsdClient->setSamplingRates( $config->get( 'StatsdSamplingRates' ) );
* @param LoggerInterface $runJobsLogger
*/
private function triggerSyncJobs( $n, LoggerInterface $runJobsLogger ) {
- $runner = new JobRunner( $runJobsLogger );
- $runner->run( [ 'maxJobs' => $n ] );
+ $trxProfiler = Profiler::instance()->getTransactionProfiler();
+ $old = $trxProfiler->setSilenced( true );
+ try {
+ $runner = new JobRunner( $runJobsLogger );
+ $runner->run( [ 'maxJobs' => $n ] );
+ } finally {
+ $trxProfiler->setSilenced( $old );
+ }
}
/**