Track which web request created a job
authorErik Bernhardson <ebernhardson@wikimedia.org>
Mon, 11 Apr 2016 21:00:43 +0000 (14:00 -0700)
committerErik Bernhardson <ebernhardson@wikimedia.org>
Wed, 13 Apr 2016 17:41:13 +0000 (10:41 -0700)
commitafc3b5a120a43a70c447ea15bfe85ba153a7ef10
tree9e3838d7835b1a6e2036c2d0f67ff4c52df85d94
parent3b480dd42bd3b4de57a4641ccd7d7f3f3f0ff4c3
Track which web request created a job

We currently push a request id into structured logging (monolog/
logstash) to allow seeing all logs that were triggered by the same
request. This extends that to pass the id through jobs so jobs triggered
by a web request also share the same id and can be tracked together.
This web request id will follow jobs both directly created by a request,
and jobs created by those jobs.

This should give us some more visibility when debugging into what
started a particular job, and if a large number of jobs blowing up the
job queue are somehow related.

Change-Id: Iedbd031e6e9bb18fd6f7b923c8c305102255ab4b
includes/WebRequest.php
includes/jobqueue/Job.php
includes/jobqueue/JobRunner.php
tests/phpunit/includes/jobqueue/JobTest.php