I applaud your efforts to learn 
So a couple of useful tips regarding workers and messages: workers only ever process 1 message at a time, and while they are processing that message they don’t do anything else.
If you look at the line:
[----] I, [2017-10-02T13:16:27.510899 #1626:106f134] INFO – : MIQ(MiqGenericWorker::Runner#get_message_via_drb)
You’ll see that the worker with PID 1626 has just dequeued message ID 11000103556134, and will process it. If you now grep for ‘#1626:’ in evm.log you’ll see the log lines from the worker processing this message, up until the next ‘Delivered in’ line:
[----] I, [2017-10-02T13:16:27.609743 #1626:106f134] INFO – : Q-task_id([service_template_provision_task_11000000000123]) MIQ(MiqQueue#delivered) Message id: [11000103556134], State: [ok], Delivered in [0.098705016] seconds
So pairing up get_message_via_drb
and MiqQueue#delivered
log lines for a worker PID gives you a good idea of what each worker is doing. You can match up worker names to their PID using rake evm:status
The way that I trace code is probably horribly inefficient (I’m not a core developer and I welcome better suggestions), but I rsync /opt/rh/cfme-gemset/* and /var/www/miq/vmdb/* from a current appliance to a ‘sources’ directory on my laptop.
To follow ServiceTemplateProvisionTask.execute
I’d then do something like:
grep -iR 'def execute' --include=*.rb *
to find out where a method called execute
was defined.
We know from vmdb/app/models/service_template_provision_task.rb
that a ServiceTemplateProvisionTask derives from a MiqRequestTask:
class ServiceTemplateProvisionTask < MiqRequestTask
and the grep shows this as a likely candidate:
vmdb/app/models/miq_request_task.rb: def execute
Looking at this file show that the execute
method calls do_request
, and another grep shows:
vmdb/app/models/service_template_provision_task.rb: def do_request
Now the do_request
method runs:
miq_request_tasks.each(&:deliver_to_automate)
and the deliver_to_automate
method (also in service_template_provision_task.rb) queues another message:
...
MiqQueue.put(
:class_name => 'MiqAeEngine',
:method_name => 'deliver',
...
so in evm.log you should be able to see a line corresponding to this MiqQueue.put.
It’s a relatively painful iterative process of grepping the code, grepping the logs, and cross-referencing, and I’d welcome better suggestions.
Hope this helps,
pemcg