include job shard in process name for worker
test plan: * run delayed jobs * using `ps aux | grep delay` confirm that the worker's shard id is included in the wait (likely 1) * in console, do `Kernel.send_later(:sleep, 60)` * using `ps aux | grep delay` confirm that the job's shard id is included (likely 1) Change-Id: I4ef23c5fba72ae72441ba40e5890d5678a8223c3 Reviewed-on: https://gerrit.instructure.com/40210 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Jacob Fugal <jacob@instructure.com> QA-Review: August Thornton <august@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
833124e8ce
commit
dc535d3249
|
@ -136,7 +136,7 @@ class Worker
|
|||
end
|
||||
end
|
||||
else
|
||||
set_process_name("wait:#{@queue}:#{min_priority || 0}:#{max_priority || 'max'}")
|
||||
set_process_name("wait:#{Shard.current(:delayed_jobs).id}~#{@queue}:#{min_priority || 0}:#{max_priority || 'max'}")
|
||||
sleep(sleep_delay + (rand * sleep_delay_stagger))
|
||||
end
|
||||
end
|
||||
|
@ -144,7 +144,7 @@ class Worker
|
|||
def perform(job)
|
||||
count = 1
|
||||
self.class.lifecycle.run_callbacks(:perform, self, job) do
|
||||
set_process_name("run:#{job.id}:#{job.name}")
|
||||
set_process_name("run:#{Shard.current(:delayed_jobs).id}~#{job.id}:#{job.name}")
|
||||
say("Processing #{log_job(job, :long)}", :info)
|
||||
runtime = Benchmark.realtime do
|
||||
if job.batch?
|
||||
|
|
Loading…
Reference in New Issue