Author |
Message |
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
COM run jobs and queues |
|
Hi
If I run a job from the remote COM interface W24x7RC.vbRemote24x7 it doesn't seem to run in it's assigned queue, it runs in the 'background' queue. Is this correct behaviour?
|
|
Thu Sep 30, 2010 5:20 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7854
|
|
|
|
It depends on how you start the job. If you use RunJob method, it starts the job immediately, bypassing all queues. You can see it in the background queue as if it was an asynchronous job. If you use QueueJob methods, the job runs normally, it goes to the associated job queue where it is picked as started based on the queue availability (e.g. ASAP).
|
|
Thu Sep 30, 2010 11:00 pm |
|
|
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
|
|
uh....there is no queuejob method in the windows version....thats annoying.
KillShellCommand Method int KillShellCommand (int)
LogMessage Method int LogMessage (int, string, int, string, bool)
OpenSession Method int OpenSession (string, string, string, string, string, string, bool)
ProtectJob Method int ProtectJob (string, string, string)
ReleaseJob Method int ReleaseJob (int)
RestartServer Method int RestartServer ()
|
|
Thu Sep 30, 2010 11:07 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7854
|
|
|
|
You are correct, that method is available in MP Version which has a richer programming interface.
Well, try then specifying false for the second parameter in RunJob
|
|
Thu Sep 30, 2010 11:13 pm |
|
|
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
|
|
it's already false. it runs synchronously which is what I'm trying for but unfortunately I can't advantage of the concurrent-run protection implied using the queue to protect a sub-application that can't be run over the top of itself.
|
|
Thu Sep 30, 2010 11:18 pm |
|
|
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
|
|
Also, what is the session timeout value on a W24x7RC.vbRemote24x7 com+ session? I could potentially use getjoblist etc to do it but not if I get timed out too soon.
|
|
Thu Sep 30, 2010 11:20 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7854
|
|
|
|
I'm not aware of any explicitly defined session timeouts. Perhaps there is some implicit generic timeout for network based send/receive/wait operations.
|
|
Fri Oct 01, 2010 8:09 am |
|
|
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
|
|
Is it a viable solution to this to use a staging job?
So for example ; requirement is to submit a job to a queue using the com+object;
COM+ object runs an intermediary job in the background which has one line of JAL in it; jobsendtoqueue(actualjob)
Can you think of anything that would make that not work?
|
|
Sun Oct 17, 2010 5:47 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7854
|
|
|
|
That sounds like doable.
Have you thought about starting the job using simple command run method for 24x7.exe /JOB [target job] command. You can kick it using the same COM interface and don't wait for the command to complete. The result should be the same as in your scenario, but without any intermediate background jobs.
|
|
Mon Oct 18, 2010 1:21 am |
|
|
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
|
|
Using RunShellcommand? How bout RunScript....what queue would runscript run in?
|
|
Mon Oct 18, 2010 4:38 pm |
|
|
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
|
|
Ok so there's a few issues with JobSendToQueue
a) the code inserter in the script editor doesn't have the correct parameters for that, it doesn't include the PID number return var
b) the statement works fine when running in the debugger or 'test' mode but normal mode causes a crash with exit code 3221225477 in the log. It's a detached job so no main scheduler crash
This is win version 3.6.9 running on vista, I've not attempted to use it via the com+ object yet.
|
|
Mon Oct 18, 2010 7:45 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7854
|
|
|
|
|
|
Using RunShellcommand? How bout RunScript....what queue would runscript run in? |
RunScript is a synchronous call. As far as I understand you are looking for a way to spawn a process and let it go, not waiting for the completion. That's what makes RunShellcommand different. It supports Async parameter which if set to True would allow you to spawn and asynchronous background process.
|
|
Mon Oct 18, 2010 9:42 pm |
|
|
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
|
|
Not so much looking to spawn an asynch process as wanting to use the queue functionality from an external call, as if the queuejob function was available.
|
|
Mon Oct 18, 2010 9:43 pm |
|
|
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7854
|
|
|
|
|
|
a) the code inserter in the script editor doesn't have the correct parameters for that, it doesn't include the PID number return var |
Here is description from the on-line help. It looks accurate to me.
Syntax: JobSendToQueue job, return
Argument Description
Job A string whose value is ether job ID or job name
return A numeric variable receiving the value of the job run-time ID
|
|
b) the statement works fine when running in the debugger or 'test' mode but normal mode causes a crash with exit code 3221225477 in the log. It's a detached job so no main scheduler crash |
Do you call it by job name or number?
What do you get in the debug.log before the crash?
|
|
Mon Oct 18, 2010 9:46 pm |
|
|
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
|
|
Here is a screenshot of the 'paste jal syntax' window showing the missing parameter
Here's the debug log - the crash only happens when the controlling job is 'detached'
19/10/2010 14:49:17.673 0 0 0 DEBUG [THREAD 5152] queue21 Queue Manager: Job #1529 - Running job as a detached process...
19/10/2010 14:49:17.677 0 0 0 DEBUG [THREAD 5152] queue21 Queue Manager: Job #1529 - waiting for the process to complete
19/10/2010 14:49:18.393 0 0 0 DEBUG [THREAD 3948] Processing notification event of type 0
19/10/2010 14:49:18.397 0 0 0 DEBUG [THREAD 3948] JobEngine - RUN - Processing job #1529; Job type:S; Async: false
19/10/2010 14:49:18.403 0 0 0 DEBUG [THREAD 3948] ScriptEngine Instance 2917592 - SharedObjectGet - Script Library SUCCESSFUL
19/10/2010 14:49:18.410 0 0 0 DEBUG [THREAD 3948] ScriptEngine Instance 2917592 - Script Library found 0 statements.
19/10/2010 14:49:18.440 0 0 0 DEBUG [THREAD 3948] UE - job_send2queue: Queuing job sleepandfinish
19/10/2010 14:49:18.491 2 0 0 DEBUG [THREAD 3948] 24x7 Scheduler: Internal Error #2/80 occurred in main while executing runjobs. Error: Null object reference
19/10/2010 14:49:18.493 2 0 0 DEBUG [THREAD 3948] Internal Error #2/80 occurred in main while executing runjobs. Error: Null object reference
Here is windows behaviour
|
|
Mon Oct 18, 2010 9:53 pm |
|
|
|