Debugging conversion worker.

alt=
DannyA
@dannya
8 years ago
584 posts
After my last update of the core and the cloud modules, my conversions are not working again. The task is being received by the queue server, and the queue server is successfully pinging conversion server. However the conversion server is not picking up the task. The task is just sitting in the queue.

How do I debug this?
updated by @dannya: 03/14/17 01:18:54AM
brian
@brian
8 years ago
10,148 posts
Are you running Jamroom 6? If so, try this - in jrCore/lib/util.php you'll find the "jrCore_queue_get" function - at the top you will see this:

function jrCore_queue_get($module, $name, $worker = null, $system_id = null){
    global $_mods;
    if (!isset($_mods[$module])) {
        // Bad module
        return false;
    }
    if (is_null($worker) || strlen($worker) === 0) {
        $worker = getmypid();
    }

Remove the module check part so it looks like this:

function jrCore_queue_get($module, $name, $worker = null, $system_id = null){
    if (is_null($worker) || strlen($worker) === 0) {
        $worker = getmypid();
    }

Let me know if that helps. I just saw this issue on another site as well, but that bit of code has been there for some time so not sure why it would crop up now.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
sbhadauria
@sbhadauria
8 years ago
129 posts
not working. I am using Jamroom 6.0.2

I am trying to debug this function "jrCore_queue_get" but it is not calling when adding task in queue server
updated by @sbhadauria: 12/10/16 08:35:11AM
brian
@brian
8 years ago
10,148 posts
Correct - it is not called when ADDING a queue entry (that is jrCore_queue_create). jrCore_queue_get is called when a queue entry is requested.

Try modifying the jrCore_queue_create function and remove this part:

    if (!isset($_mods[$module])) {
        // Bad module
        return false;
    }

Near the top - let me know if that works.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
sbhadauria
@sbhadauria
8 years ago
129 posts
not working.

One more thing "process_stats" task is automatically creating in queue server
updated by @sbhadauria: 12/10/16 09:37:07AM
brian
@brian
8 years ago
10,148 posts
We are running 6.0.2 here without issue. It could be that your workers have "failed" and did not cleanup. Go into the Queue viewer and "reset" and worker that has been working for too long.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
sbhadauria
@sbhadauria
8 years ago
129 posts
I have cleared and reset but conversion worker but not working. Can you please tell me which function is calling to trigger task on conversion worker.
brian
@brian
8 years ago
10,148 posts
sbhadauria:
I have cleared and reset but conversion worker but not working. Can you please tell me which function is calling to trigger task on conversion worker.

There is no specific function that triggers - the conversion server's Queue Client checks for Queue entries on the Queue Server at the interval set in the conversion server's Queue Client "Watch Rate" global config setting.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
DannyA
@dannya
8 years ago
584 posts
So is there a function in the queue client that does the check? It sounds like we need to debug that function and see why it's not picking up the job.
brian
@brian
8 years ago
10,148 posts
DannyA:
So is there a function in the queue client that does the check? It sounds like we need to debug that function and see why it's not picking up the job.

Make sure the parts I outlined above are commented out - those module checks shouldn't be there (and will be fixed in the next release). That's the only thing that could cause an issue.

We're running 6.0.2 with those modifications here and it's working.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
DannyA
@dannya
8 years ago
584 posts
Ya. Its commented out. Still nothing.
Are you running queue server and queue clients on different servers? We are.

Is there any way to log the queue client request? I.e., to figure out if the request is being made and being received or if the problem is with the response from the queue server?
sbhadauria
@sbhadauria
8 years ago
129 posts
After debugging I have found that "jrCloudQueueClient_check_queues_ready_listener" returning queue array with only queue name. for eg.
array(
    [audio_conversion] => array(queue_name=>audio_conversion)
)

But in "jrCore_process_exit_listener" in include.php file of jrCore module we have a condition which is checking queue name with module that's why conversion worker not working:
// Only process entries for queue we actually have
if (!isset($_qn["{$mod}_{$qname}"])) {
       continue;
}

After modifying "jrCloudQueueClient_check_queues_ready_listener" to return queue array with module name, conversion worker started again.
array(
    [jrAudio_audio_conversion] => array(queue_name=>audio_conversion)
)

updated by @sbhadauria: 12/13/16 12:18:08AM
brian
@brian
8 years ago
10,148 posts
DannyA:
Are you running queue server and queue clients on different servers? We are.

Of course - we have hundreds of sites using our conversion service (through our hosting).

sbhadauria:
After modifying "jrCloudQueueClient_check_queues_ready_listener" to return queue array with module name, conversion worker started again.

I'm glad that is working now for you. That format was changed a while back though, so you should not have had to do that. But glad it is working.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags